react-native-tab-view 3.3.0 → 3.3.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/{LICENSE.md → LICENSE} +0 -0
- package/README.md +5 -36
- package/lib/commonjs/PagerViewAdapter.js.map +1 -1
- package/lib/commonjs/PanResponderAdapter.js +1 -1
- package/lib/commonjs/PanResponderAdapter.js.map +1 -1
- package/lib/commonjs/SceneMap.js.map +1 -1
- package/lib/commonjs/SceneView.js.map +1 -1
- package/lib/commonjs/TabBar.js +42 -9
- package/lib/commonjs/TabBar.js.map +1 -1
- package/lib/commonjs/TabBarIndicator.js +4 -4
- package/lib/commonjs/TabBarIndicator.js.map +1 -1
- package/lib/commonjs/TabBarItem.js.map +1 -1
- package/lib/commonjs/TabView.js +2 -2
- package/lib/commonjs/TabView.js.map +1 -1
- package/lib/commonjs/index.js +3 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/PagerViewAdapter.js.map +1 -1
- package/lib/module/PanResponderAdapter.js +2 -2
- package/lib/module/PanResponderAdapter.js.map +1 -1
- package/lib/module/SceneMap.js.map +1 -1
- package/lib/module/SceneView.js +1 -1
- package/lib/module/SceneView.js.map +1 -1
- package/lib/module/TabBar.js +41 -10
- package/lib/module/TabBar.js.map +1 -1
- package/lib/module/TabBarIndicator.js +5 -5
- package/lib/module/TabBarIndicator.js.map +1 -1
- package/lib/module/TabBarItem.js.map +1 -1
- package/lib/module/TabView.js +2 -2
- package/lib/module/TabView.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/{Pager.android.d.ts → src/Pager.android.d.ts} +0 -0
- package/lib/typescript/{Pager.d.ts → src/Pager.d.ts} +0 -0
- package/lib/typescript/{Pager.ios.d.ts → src/Pager.ios.d.ts} +0 -0
- package/lib/typescript/{PagerViewAdapter.d.ts → src/PagerViewAdapter.d.ts} +1 -1
- package/lib/typescript/{PanResponderAdapter.d.ts → src/PanResponderAdapter.d.ts} +1 -1
- package/lib/typescript/{PlatformPressable.d.ts → src/PlatformPressable.d.ts} +0 -0
- package/lib/typescript/{SceneMap.d.ts → src/SceneMap.d.ts} +0 -0
- package/lib/typescript/{SceneView.d.ts → src/SceneView.d.ts} +1 -1
- package/lib/typescript/{TabBar.d.ts → src/TabBar.d.ts} +5 -4
- package/lib/typescript/{TabBarIndicator.d.ts → src/TabBarIndicator.d.ts} +1 -1
- package/lib/typescript/{TabBarItem.d.ts → src/TabBarItem.d.ts} +2 -2
- package/lib/typescript/{TabView.d.ts → src/TabView.d.ts} +1 -1
- package/lib/typescript/{index.d.ts → src/index.d.ts} +7 -7
- package/lib/typescript/{types.d.ts → src/types.d.ts} +0 -0
- package/lib/typescript/{useAnimatedValue.d.ts → src/useAnimatedValue.d.ts} +0 -0
- package/package.json +27 -60
- package/src/PagerViewAdapter.tsx +5 -4
- package/src/PanResponderAdapter.tsx +10 -9
- package/src/SceneMap.tsx +1 -0
- package/src/SceneView.tsx +3 -2
- package/src/TabBar.tsx +59 -14
- package/src/TabBarIndicator.tsx +11 -8
- package/src/TabBarItem.tsx +5 -4
- package/src/TabView.tsx +6 -5
- package/src/index.tsx +7 -12
package/lib/module/TabBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Animated","StyleSheet","View","I18nManager","Platform","TabBarItem","TabBarIndicator","useAnimatedValue","Separator","width","getFlattenedTabWidth","style","tabStyle","flatten","getComputedTabWidth","index","layout","routes","scrollEnabled","tabWidths","flattenedWidth","key","endsWith","parseFloat","Number","isFinite","length","getMaxScrollDistance","tabBarWidth","layoutWidth","getTranslateX","scrollAmount","maxScrollDistance","multiply","OS","isRTL","add","getTabBarWidth","navigationState","gap","flattenedTabWidth","reduce","acc","_","i","normalizeScrollValue","value","maxDistance","scrollValue","Math","max","min","getScrollAmount","centerDistance","Array","from","total","tabWidth","getLabelTextDefault","route","title","getAccessibleDefault","accessible","getAccessibilityLabelDefault","accessibilityLabel","undefined","renderIndicatorDefault","props","getTestIdDefault","testID","TabBar","getLabelText","getAccessible","getAccessibilityLabel","getTestID","renderIndicator","jumpTo","position","activeColor","bounces","contentContainerStyle","inactiveColor","indicatorContainerStyle","indicatorStyle","labelStyle","onTabLongPress","onTabPress","pressColor","pressOpacity","renderBadge","renderIcon","renderLabel","renderTabBarItem","setLayout","useState","height","setTabWidths","flatListRef","useRef","isFirst","measuredTabWidths","isWidthDynamic","scrollOffset","hasMeasuredTabWidths","Boolean","every","r","useEffect","current","scrollToOffset","offset","animated","handleLayout","e","nativeEvent","separatorsWidth","separatorPercent","tabBarWidthPercent","translateX","useMemo","renderItem","useCallback","item","onLayout","onPress","event","defaultPrevented","preventDefault","onLongPress","defaultTabWidth","keyExtractor","contentContainerStyleMemoized","styles","tabContent","container","handleScroll","contentOffset","x","useNativeDriver","tabBar","indicatorContainer","transform","getTabWidth","scroll","create","flex","overflow","select","default","web","backgroundColor","elevation","shadowColor","shadowOpacity","shadowRadius","hairlineWidth","shadowOffset","zIndex","flexDirection","flexWrap","top","left","right","bottom"],"sources":["TabBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n StyleSheet,\n View,\n StyleProp,\n ViewStyle,\n TextStyle,\n LayoutChangeEvent,\n I18nManager,\n Platform,\n FlatList,\n ListRenderItemInfo,\n} from 'react-native';\nimport TabBarItem, { Props as TabBarItemProps } from './TabBarItem';\nimport TabBarIndicator, { Props as IndicatorProps } from './TabBarIndicator';\nimport type {\n Route,\n Scene,\n SceneRendererProps,\n NavigationState,\n Layout,\n Event,\n} from './types';\nimport useAnimatedValue from './useAnimatedValue';\n\nexport type Props<T extends Route> = SceneRendererProps & {\n navigationState: NavigationState<T>;\n scrollEnabled?: boolean;\n bounces?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n getLabelText?: (scene: Scene<T>) => string | undefined;\n getAccessible?: (scene: Scene<T>) => boolean | undefined;\n getAccessibilityLabel?: (scene: Scene<T>) => string | undefined;\n getTestID?: (scene: Scene<T>) => string | undefined;\n renderLabel?: (\n scene: Scene<T> & {\n focused: boolean;\n color: string;\n }\n ) => React.ReactNode;\n renderIcon?: (\n scene: Scene<T> & {\n focused: boolean;\n color: string;\n }\n ) => React.ReactNode;\n renderBadge?: (scene: Scene<T>) => React.ReactNode;\n renderIndicator?: (props: IndicatorProps<T>) => React.ReactNode;\n renderTabBarItem?: (\n props: TabBarItemProps<T> & { key: string }\n ) => React.ReactElement;\n onTabPress?: (scene: Scene<T> & Event) => void;\n onTabLongPress?: (scene: Scene<T>) => void;\n tabStyle?: StyleProp<ViewStyle>;\n indicatorStyle?: StyleProp<ViewStyle>;\n indicatorContainerStyle?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n contentContainerStyle?: StyleProp<ViewStyle>;\n style?: StyleProp<ViewStyle>;\n gap?: number;\n};\n\ntype FlattenedTabWidth = string | number | undefined;\n\nconst Separator = ({ width }: { width: number }) => {\n return <View style={{ width }} />;\n};\n\nconst getFlattenedTabWidth = (style: StyleProp<ViewStyle>) => {\n const tabStyle = StyleSheet.flatten(style);\n\n return tabStyle?.width;\n};\n\nconst getComputedTabWidth = (\n index: number,\n layout: Layout,\n routes: Route[],\n scrollEnabled: boolean | undefined,\n tabWidths: { [key: string]: number },\n flattenedWidth: FlattenedTabWidth\n) => {\n if (flattenedWidth === 'auto') {\n return tabWidths[routes[index].key] || 0;\n }\n\n switch (typeof flattenedWidth) {\n case 'number':\n return flattenedWidth;\n case 'string':\n if (flattenedWidth.endsWith('%')) {\n const width = parseFloat(flattenedWidth);\n if (Number.isFinite(width)) {\n return layout.width * (width / 100);\n }\n }\n }\n\n if (scrollEnabled) {\n return (layout.width / 5) * 2;\n }\n return layout.width / routes.length;\n};\n\nconst getMaxScrollDistance = (tabBarWidth: number, layoutWidth: number) =>\n tabBarWidth - layoutWidth;\n\nconst getTranslateX = (\n scrollAmount: Animated.Value,\n maxScrollDistance: number\n) =>\n Animated.multiply(\n Platform.OS === 'android' && I18nManager.isRTL\n ? Animated.add(maxScrollDistance, Animated.multiply(scrollAmount, -1))\n : scrollAmount,\n I18nManager.isRTL ? 1 : -1\n );\n\nconst getTabBarWidth = <T extends Route>({\n navigationState,\n layout,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n tabWidths,\n}: Pick<Props<T>, 'navigationState' | 'gap' | 'layout' | 'scrollEnabled'> & {\n tabWidths: Record<string, number>;\n flattenedTabWidth: FlattenedTabWidth;\n}) => {\n const { routes } = navigationState;\n\n return routes.reduce<number>(\n (acc, _, i) =>\n acc +\n (i > 0 ? gap ?? 0 : 0) +\n getComputedTabWidth(\n i,\n layout,\n routes,\n scrollEnabled,\n tabWidths,\n flattenedTabWidth\n ),\n 0\n );\n};\n\nconst normalizeScrollValue = <T extends Route>({\n layout,\n navigationState,\n gap,\n scrollEnabled,\n tabWidths,\n value,\n flattenedTabWidth,\n}: Pick<Props<T>, 'layout' | 'navigationState' | 'gap' | 'scrollEnabled'> & {\n tabWidths: Record<string, number>;\n value: number;\n flattenedTabWidth: FlattenedTabWidth;\n}) => {\n const tabBarWidth = getTabBarWidth({\n layout,\n navigationState,\n tabWidths,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n const maxDistance = getMaxScrollDistance(tabBarWidth, layout.width);\n const scrollValue = Math.max(Math.min(value, maxDistance), 0);\n\n if (Platform.OS === 'android' && I18nManager.isRTL) {\n // On Android, scroll value is not applied in reverse in RTL\n // so we need to manually adjust it to apply correct value\n return maxDistance - scrollValue;\n }\n\n return scrollValue;\n};\n\nconst getScrollAmount = <T extends Route>({\n layout,\n navigationState,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n tabWidths,\n}: Pick<Props<T>, 'layout' | 'navigationState' | 'scrollEnabled' | 'gap'> & {\n tabWidths: Record<string, number>;\n flattenedTabWidth: FlattenedTabWidth;\n}) => {\n const centerDistance = Array.from({\n length: navigationState.index + 1,\n }).reduce<number>((total, _, i) => {\n const tabWidth = getComputedTabWidth(\n i,\n layout,\n navigationState.routes,\n scrollEnabled,\n tabWidths,\n flattenedTabWidth\n );\n\n // To get the current index centered we adjust scroll amount by width of indexes\n // 0 through (i - 1) and add half the width of current index i\n return (\n total +\n (navigationState.index === i\n ? (tabWidth + (gap ?? 0)) / 2\n : tabWidth + (gap ?? 0))\n );\n }, 0);\n\n const scrollAmount = centerDistance - layout.width / 2;\n\n return normalizeScrollValue({\n layout,\n navigationState,\n tabWidths,\n value: scrollAmount,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n};\n\nconst getLabelTextDefault = ({ route }: Scene<Route>) => route.title;\n\nconst getAccessibleDefault = ({ route }: Scene<Route>) =>\n typeof route.accessible !== 'undefined' ? route.accessible : true;\n\nconst getAccessibilityLabelDefault = ({ route }: Scene<Route>) =>\n typeof route.accessibilityLabel === 'string'\n ? route.accessibilityLabel\n : typeof route.title === 'string'\n ? route.title\n : undefined;\n\nconst renderIndicatorDefault = (props: IndicatorProps<Route>) => (\n <TabBarIndicator {...props} />\n);\n\nconst getTestIdDefault = ({ route }: Scene<Route>) => route.testID;\n\nexport default function TabBar<T extends Route>({\n getLabelText = getLabelTextDefault,\n getAccessible = getAccessibleDefault,\n getAccessibilityLabel = getAccessibilityLabelDefault,\n getTestID = getTestIdDefault,\n renderIndicator = renderIndicatorDefault,\n gap = 0,\n scrollEnabled,\n jumpTo,\n navigationState,\n position,\n activeColor,\n bounces,\n contentContainerStyle,\n inactiveColor,\n indicatorContainerStyle,\n indicatorStyle,\n labelStyle,\n onTabLongPress,\n onTabPress,\n pressColor,\n pressOpacity,\n renderBadge,\n renderIcon,\n renderLabel,\n renderTabBarItem,\n style,\n tabStyle,\n}: Props<T>) {\n const [layout, setLayout] = React.useState<Layout>({ width: 0, height: 0 });\n const [tabWidths, setTabWidths] = React.useState<Record<string, number>>({});\n const flatListRef = React.useRef<FlatList>(null);\n const isFirst = React.useRef(true);\n const scrollAmount = useAnimatedValue(0);\n const measuredTabWidths = React.useRef<Record<string, number>>({});\n\n const { routes } = navigationState;\n const flattenedTabWidth = getFlattenedTabWidth(tabStyle);\n const isWidthDynamic = flattenedTabWidth === 'auto';\n const scrollOffset = getScrollAmount({\n layout,\n navigationState,\n tabWidths,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n\n const hasMeasuredTabWidths =\n Boolean(layout.width) &&\n routes.every((r) => typeof tabWidths[r.key] === 'number');\n\n React.useEffect(() => {\n if (isFirst.current) {\n isFirst.current = false;\n return;\n }\n\n if (isWidthDynamic && !hasMeasuredTabWidths) {\n // When tab width is dynamic, only adjust the scroll once we have all tab widths and layout\n return;\n }\n\n if (scrollEnabled) {\n flatListRef.current?.scrollToOffset({\n offset: scrollOffset,\n animated: true,\n });\n }\n }, [hasMeasuredTabWidths, isWidthDynamic, scrollEnabled, scrollOffset]);\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n setLayout((layout) =>\n layout.width === width && layout.height === height\n ? layout\n : { width, height }\n );\n };\n\n const tabBarWidth = getTabBarWidth({\n layout,\n navigationState,\n tabWidths,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n\n const separatorsWidth = Math.max(0, routes.length - 1) * gap;\n const separatorPercent = (separatorsWidth / tabBarWidth) * 100;\n const tabBarWidthPercent = `${routes.length * 40}%`;\n\n const translateX = React.useMemo(\n () =>\n getTranslateX(\n scrollAmount,\n getMaxScrollDistance(tabBarWidth, layout.width)\n ),\n [layout.width, scrollAmount, tabBarWidth]\n );\n\n const renderItem = React.useCallback(\n ({ item: route, index }: ListRenderItemInfo<T>) => {\n const props: TabBarItemProps<T> & { key: string } = {\n key: route.key,\n position: position,\n route: route,\n navigationState: navigationState,\n getAccessibilityLabel: getAccessibilityLabel,\n getAccessible: getAccessible,\n getLabelText: getLabelText,\n getTestID: getTestID,\n renderBadge: renderBadge,\n renderIcon: renderIcon,\n renderLabel: renderLabel,\n activeColor: activeColor,\n inactiveColor: inactiveColor,\n pressColor: pressColor,\n pressOpacity: pressOpacity,\n onLayout: isWidthDynamic\n ? (e: LayoutChangeEvent) => {\n measuredTabWidths.current[route.key] = e.nativeEvent.layout.width;\n\n // When we have measured widths for all of the tabs, we should updates the state\n // We avoid doing separate setState for each layout since it triggers multiple renders and slows down app\n if (\n routes.every(\n (r) => typeof measuredTabWidths.current[r.key] === 'number'\n )\n ) {\n setTabWidths({ ...measuredTabWidths.current });\n }\n }\n : undefined,\n onPress: () => {\n const event: Scene<T> & Event = {\n route,\n defaultPrevented: false,\n preventDefault: () => {\n event.defaultPrevented = true;\n },\n };\n\n onTabPress?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n jumpTo(route.key);\n },\n onLongPress: () => onTabLongPress?.({ route }),\n labelStyle: labelStyle,\n style: tabStyle,\n // Calculate the deafult width for tab for FlatList to work\n defaultTabWidth: !isWidthDynamic\n ? getComputedTabWidth(\n index,\n layout,\n routes,\n scrollEnabled,\n tabWidths,\n getFlattenedTabWidth(tabStyle)\n )\n : undefined,\n };\n\n return (\n <>\n {gap > 0 && index > 0 ? <Separator width={gap} /> : null}\n {renderTabBarItem ? (\n renderTabBarItem(props)\n ) : (\n <TabBarItem {...props} />\n )}\n </>\n );\n },\n [\n activeColor,\n gap,\n getAccessibilityLabel,\n getAccessible,\n getLabelText,\n getTestID,\n inactiveColor,\n isWidthDynamic,\n jumpTo,\n labelStyle,\n layout,\n navigationState,\n onTabLongPress,\n onTabPress,\n position,\n pressColor,\n pressOpacity,\n renderBadge,\n renderIcon,\n renderLabel,\n renderTabBarItem,\n routes,\n scrollEnabled,\n tabStyle,\n tabWidths,\n ]\n );\n\n const keyExtractor = React.useCallback((item: T) => item.key, []);\n\n const contentContainerStyleMemoized = React.useMemo(\n () => [\n styles.tabContent,\n scrollEnabled\n ? {\n width:\n tabBarWidth > separatorsWidth ? tabBarWidth : tabBarWidthPercent,\n }\n : styles.container,\n contentContainerStyle,\n ],\n [\n contentContainerStyle,\n scrollEnabled,\n separatorsWidth,\n tabBarWidth,\n tabBarWidthPercent,\n ]\n );\n\n const handleScroll = React.useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n contentOffset: { x: scrollAmount },\n },\n },\n ],\n { useNativeDriver: true }\n ),\n [scrollAmount]\n );\n\n return (\n <Animated.View onLayout={handleLayout} style={[styles.tabBar, style]}>\n <Animated.View\n pointerEvents=\"none\"\n style={[\n styles.indicatorContainer,\n scrollEnabled ? { transform: [{ translateX }] as any } : null,\n tabBarWidth > separatorsWidth\n ? { width: tabBarWidth - separatorsWidth }\n : scrollEnabled\n ? { width: tabBarWidthPercent }\n : null,\n indicatorContainerStyle,\n ]}\n >\n {renderIndicator({\n position,\n layout,\n navigationState,\n jumpTo,\n width: isWidthDynamic\n ? 'auto'\n : `${(100 - separatorPercent) / routes.length}%`,\n style: indicatorStyle,\n getTabWidth: (i: number) =>\n getComputedTabWidth(\n i,\n layout,\n routes,\n scrollEnabled,\n tabWidths,\n flattenedTabWidth\n ),\n gap,\n })}\n </Animated.View>\n <View style={styles.scroll}>\n <Animated.FlatList\n data={routes as Animated.WithAnimatedValue<T>[]}\n keyExtractor={keyExtractor}\n horizontal\n accessibilityRole=\"tablist\"\n keyboardShouldPersistTaps=\"handled\"\n scrollEnabled={scrollEnabled}\n bounces={bounces}\n alwaysBounceHorizontal={false}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n automaticallyAdjustContentInsets={false}\n overScrollMode=\"never\"\n contentContainerStyle={contentContainerStyleMemoized}\n scrollEventThrottle={16}\n renderItem={renderItem}\n onScroll={handleScroll}\n ref={flatListRef}\n />\n </View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n scroll: {\n overflow: Platform.select({ default: 'scroll', web: undefined }),\n },\n tabBar: {\n backgroundColor: '#2196f3',\n elevation: 4,\n shadowColor: 'black',\n shadowOpacity: 0.1,\n shadowRadius: StyleSheet.hairlineWidth,\n shadowOffset: {\n height: StyleSheet.hairlineWidth,\n width: 0,\n },\n zIndex: 1,\n },\n tabContent: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n },\n indicatorContainer: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,UAFF,EAGEC,IAHF,EAQEC,WARF,EASEC,QATF,QAYO,cAZP;AAaA,OAAOC,UAAP,MAAqD,cAArD;AACA,OAAOC,eAAP,MAAyD,mBAAzD;AASA,OAAOC,gBAAP,MAA6B,oBAA7B;;AA4CA,MAAMC,SAAS,GAAG,QAAkC;EAAA,IAAjC;IAAEC;EAAF,CAAiC;EAClD,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAE;MAAEA;IAAF;EAAb,EAAP;AACD,CAFD;;AAIA,MAAMC,oBAAoB,GAAIC,KAAD,IAAiC;EAC5D,MAAMC,QAAQ,GAAGX,UAAU,CAACY,OAAX,CAAmBF,KAAnB,CAAjB;EAEA,OAAOC,QAAP,aAAOA,QAAP,uBAAOA,QAAQ,CAAEH,KAAjB;AACD,CAJD;;AAMA,MAAMK,mBAAmB,GAAG,CAC1BC,KAD0B,EAE1BC,MAF0B,EAG1BC,MAH0B,EAI1BC,aAJ0B,EAK1BC,SAL0B,EAM1BC,cAN0B,KAOvB;EACH,IAAIA,cAAc,KAAK,MAAvB,EAA+B;IAC7B,OAAOD,SAAS,CAACF,MAAM,CAACF,KAAD,CAAN,CAAcM,GAAf,CAAT,IAAgC,CAAvC;EACD;;EAED,QAAQ,OAAOD,cAAf;IACE,KAAK,QAAL;MACE,OAAOA,cAAP;;IACF,KAAK,QAAL;MACE,IAAIA,cAAc,CAACE,QAAf,CAAwB,GAAxB,CAAJ,EAAkC;QAChC,MAAMb,KAAK,GAAGc,UAAU,CAACH,cAAD,CAAxB;;QACA,IAAII,MAAM,CAACC,QAAP,CAAgBhB,KAA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I,UAAU,CAAC+I,MAAX,CAAkB;EAC/BV,SAAS,EAAE;IACTW,IAAI,EAAE;EADG,CADoB;EAI/BF,MAAM,EAAE;IACNG,QAAQ,EAAE9I,QAAQ,CAAC+I,MAAT,CAAgB;MAAEC,OAAO,EAAE,QAAX;MAAqBC,GAAG,EAAEpF;IAA1B,CAAhB;EADJ,CAJuB;EAO/B0E,MAAM,EAAE;IACNW,eAAe,EAAE,SADX;IAENC,SAAS,EAAE,CAFL;IAGNC,WAAW,EAAE,OAHP;IAINC,aAAa,EAAE,GAJT;IAKNC,YAAY,EAAEzJ,UAAU,CAAC0J,aALnB;IAMNC,YAAY,EAAE;MACZ7D,MAAM,EAAE9F,UAAU,CAAC0J,aADP;MAEZlJ,KAAK,EAAE;IAFK,CANR;IAUNoJ,MAAM,EAAE;EAVF,CAPuB;EAmB/BxB,UAAU,EAAE;IACVyB,aAAa,EAAE,KADL;IAEVC,QAAQ,EAAE;EAFA,CAnBmB;EAuB/BnB,kBAAkB,EAAE;IAClB/D,QAAQ,EAAE,UADQ;IAElBmF,GAAG,EAAE,CAFa;IAGlBC,IAAI,EAAE,CAHY;IAIlBC,KAAK,EAAE,CAJW;IAKlBC,MAAM,EAAE;EALU;AAvBW,CAAlB,CAAf"}
|
|
1
|
+
{"version":3,"names":["React","Animated","I18nManager","Platform","StyleSheet","View","useLatestCallback","TabBarIndicator","TabBarItem","useAnimatedValue","Separator","width","getFlattenedTabWidth","style","tabStyle","flatten","getComputedTabWidth","index","layout","routes","scrollEnabled","tabWidths","flattenedWidth","key","endsWith","parseFloat","Number","isFinite","length","getMaxScrollDistance","tabBarWidth","layoutWidth","getTranslateX","scrollAmount","maxScrollDistance","multiply","OS","isRTL","add","getTabBarWidth","navigationState","gap","flattenedTabWidth","reduce","acc","_","i","normalizeScrollValue","value","maxDistance","scrollValue","Math","max","min","getScrollAmount","centerDistance","Array","from","total","tabWidth","getLabelTextDefault","route","title","getAccessibleDefault","accessible","getAccessibilityLabelDefault","accessibilityLabel","undefined","renderIndicatorDefault","props","getTestIdDefault","testID","MEASURE_PER_BATCH","TabBar","getLabelText","getAccessible","getAccessibilityLabel","getTestID","renderIndicator","jumpTo","position","activeColor","bounces","contentContainerStyle","inactiveColor","indicatorContainerStyle","indicatorStyle","labelStyle","onTabLongPress","onTabPress","pressColor","pressOpacity","renderBadge","renderIcon","renderLabel","renderTabBarItem","setLayout","useState","height","setTabWidths","flatListRef","useRef","isFirst","measuredTabWidths","isWidthDynamic","scrollOffset","hasMeasuredTabWidths","Boolean","slice","every","r","useEffect","current","scrollToOffset","offset","animated","handleLayout","e","nativeEvent","separatorsWidth","separatorPercent","tabBarWidthPercent","translateX","useMemo","renderItem","useCallback","item","onLayout","onPress","event","defaultPrevented","preventDefault","onLongPress","defaultTabWidth","keyExtractor","contentContainerStyleMemoized","styles","tabContent","container","handleScroll","contentOffset","x","useNativeDriver","handleViewableItemsChanged","changed","isViewable","tabBar","indicatorContainer","transform","getTabWidth","scroll","create","flex","overflow","select","default","web","backgroundColor","elevation","shadowColor","shadowOpacity","shadowRadius","hairlineWidth","shadowOffset","zIndex","flexDirection","flexWrap","top","left","right","bottom"],"sources":["TabBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n FlatList,\n I18nManager,\n LayoutChangeEvent,\n ListRenderItemInfo,\n Platform,\n StyleProp,\n StyleSheet,\n TextStyle,\n View,\n ViewStyle,\n ViewToken,\n} from 'react-native';\nimport useLatestCallback from 'use-latest-callback';\n\nimport TabBarIndicator, { Props as IndicatorProps } from './TabBarIndicator';\nimport TabBarItem, { Props as TabBarItemProps } from './TabBarItem';\nimport type {\n Event,\n Layout,\n NavigationState,\n Route,\n Scene,\n SceneRendererProps,\n} from './types';\nimport useAnimatedValue from './useAnimatedValue';\n\nexport type Props<T extends Route> = SceneRendererProps & {\n navigationState: NavigationState<T>;\n scrollEnabled?: boolean;\n bounces?: boolean;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n getLabelText?: (scene: Scene<T>) => string | undefined;\n getAccessible?: (scene: Scene<T>) => boolean | undefined;\n getAccessibilityLabel?: (scene: Scene<T>) => string | undefined;\n getTestID?: (scene: Scene<T>) => string | undefined;\n renderLabel?: (\n scene: Scene<T> & {\n focused: boolean;\n color: string;\n }\n ) => React.ReactNode;\n renderIcon?: (\n scene: Scene<T> & {\n focused: boolean;\n color: string;\n }\n ) => React.ReactNode;\n renderBadge?: (scene: Scene<T>) => React.ReactNode;\n renderIndicator?: (props: IndicatorProps<T>) => React.ReactNode;\n renderTabBarItem?: (\n props: TabBarItemProps<T> & { key: string }\n ) => React.ReactElement;\n onTabPress?: (scene: Scene<T> & Event) => void;\n onTabLongPress?: (scene: Scene<T>) => void;\n tabStyle?: StyleProp<ViewStyle>;\n indicatorStyle?: StyleProp<ViewStyle>;\n indicatorContainerStyle?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n contentContainerStyle?: StyleProp<ViewStyle>;\n style?: StyleProp<ViewStyle>;\n gap?: number;\n testID?: string;\n};\n\ntype FlattenedTabWidth = string | number | undefined;\n\nconst Separator = ({ width }: { width: number }) => {\n return <View style={{ width }} />;\n};\n\nconst getFlattenedTabWidth = (style: StyleProp<ViewStyle>) => {\n const tabStyle = StyleSheet.flatten(style);\n\n return tabStyle?.width;\n};\n\nconst getComputedTabWidth = (\n index: number,\n layout: Layout,\n routes: Route[],\n scrollEnabled: boolean | undefined,\n tabWidths: { [key: string]: number },\n flattenedWidth: FlattenedTabWidth\n) => {\n if (flattenedWidth === 'auto') {\n return tabWidths[routes[index].key] || 0;\n }\n\n switch (typeof flattenedWidth) {\n case 'number':\n return flattenedWidth;\n case 'string':\n if (flattenedWidth.endsWith('%')) {\n const width = parseFloat(flattenedWidth);\n if (Number.isFinite(width)) {\n return layout.width * (width / 100);\n }\n }\n }\n\n if (scrollEnabled) {\n return (layout.width / 5) * 2;\n }\n return layout.width / routes.length;\n};\n\nconst getMaxScrollDistance = (tabBarWidth: number, layoutWidth: number) =>\n tabBarWidth - layoutWidth;\n\nconst getTranslateX = (\n scrollAmount: Animated.Value,\n maxScrollDistance: number\n) =>\n Animated.multiply(\n Platform.OS === 'android' && I18nManager.isRTL\n ? Animated.add(maxScrollDistance, Animated.multiply(scrollAmount, -1))\n : scrollAmount,\n I18nManager.isRTL ? 1 : -1\n );\n\nconst getTabBarWidth = <T extends Route>({\n navigationState,\n layout,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n tabWidths,\n}: Pick<Props<T>, 'navigationState' | 'gap' | 'layout' | 'scrollEnabled'> & {\n tabWidths: Record<string, number>;\n flattenedTabWidth: FlattenedTabWidth;\n}) => {\n const { routes } = navigationState;\n\n return routes.reduce<number>(\n (acc, _, i) =>\n acc +\n (i > 0 ? gap ?? 0 : 0) +\n getComputedTabWidth(\n i,\n layout,\n routes,\n scrollEnabled,\n tabWidths,\n flattenedTabWidth\n ),\n 0\n );\n};\n\nconst normalizeScrollValue = <T extends Route>({\n layout,\n navigationState,\n gap,\n scrollEnabled,\n tabWidths,\n value,\n flattenedTabWidth,\n}: Pick<Props<T>, 'layout' | 'navigationState' | 'gap' | 'scrollEnabled'> & {\n tabWidths: Record<string, number>;\n value: number;\n flattenedTabWidth: FlattenedTabWidth;\n}) => {\n const tabBarWidth = getTabBarWidth({\n layout,\n navigationState,\n tabWidths,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n const maxDistance = getMaxScrollDistance(tabBarWidth, layout.width);\n const scrollValue = Math.max(Math.min(value, maxDistance), 0);\n\n if (Platform.OS === 'android' && I18nManager.isRTL) {\n // On Android, scroll value is not applied in reverse in RTL\n // so we need to manually adjust it to apply correct value\n return maxDistance - scrollValue;\n }\n\n return scrollValue;\n};\n\nconst getScrollAmount = <T extends Route>({\n layout,\n navigationState,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n tabWidths,\n}: Pick<Props<T>, 'layout' | 'navigationState' | 'scrollEnabled' | 'gap'> & {\n tabWidths: Record<string, number>;\n flattenedTabWidth: FlattenedTabWidth;\n}) => {\n const centerDistance = Array.from({\n length: navigationState.index + 1,\n }).reduce<number>((total, _, i) => {\n const tabWidth = getComputedTabWidth(\n i,\n layout,\n navigationState.routes,\n scrollEnabled,\n tabWidths,\n flattenedTabWidth\n );\n\n // To get the current index centered we adjust scroll amount by width of indexes\n // 0 through (i - 1) and add half the width of current index i\n return (\n total +\n (navigationState.index === i\n ? (tabWidth + (gap ?? 0)) / 2\n : tabWidth + (gap ?? 0))\n );\n }, 0);\n\n const scrollAmount = centerDistance - layout.width / 2;\n\n return normalizeScrollValue({\n layout,\n navigationState,\n tabWidths,\n value: scrollAmount,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n};\n\nconst getLabelTextDefault = ({ route }: Scene<Route>) => route.title;\n\nconst getAccessibleDefault = ({ route }: Scene<Route>) =>\n typeof route.accessible !== 'undefined' ? route.accessible : true;\n\nconst getAccessibilityLabelDefault = ({ route }: Scene<Route>) =>\n typeof route.accessibilityLabel === 'string'\n ? route.accessibilityLabel\n : typeof route.title === 'string'\n ? route.title\n : undefined;\n\nconst renderIndicatorDefault = (props: IndicatorProps<Route>) => (\n <TabBarIndicator {...props} />\n);\n\nconst getTestIdDefault = ({ route }: Scene<Route>) => route.testID;\n\n// How many items measurements should we update per batch.\n// Defaults to 10, since that's whats FlatList is using in initialNumToRender.\nconst MEASURE_PER_BATCH = 10;\n\nexport default function TabBar<T extends Route>({\n getLabelText = getLabelTextDefault,\n getAccessible = getAccessibleDefault,\n getAccessibilityLabel = getAccessibilityLabelDefault,\n getTestID = getTestIdDefault,\n renderIndicator = renderIndicatorDefault,\n gap = 0,\n scrollEnabled,\n jumpTo,\n navigationState,\n position,\n activeColor,\n bounces,\n contentContainerStyle,\n inactiveColor,\n indicatorContainerStyle,\n indicatorStyle,\n labelStyle,\n onTabLongPress,\n onTabPress,\n pressColor,\n pressOpacity,\n renderBadge,\n renderIcon,\n renderLabel,\n renderTabBarItem,\n style,\n tabStyle,\n testID,\n}: Props<T>) {\n const [layout, setLayout] = React.useState<Layout>({ width: 0, height: 0 });\n const [tabWidths, setTabWidths] = React.useState<Record<string, number>>({});\n const flatListRef = React.useRef<FlatList | null>(null);\n const isFirst = React.useRef(true);\n const scrollAmount = useAnimatedValue(0);\n const measuredTabWidths = React.useRef<Record<string, number>>({});\n\n const { routes } = navigationState;\n const flattenedTabWidth = getFlattenedTabWidth(tabStyle);\n const isWidthDynamic = flattenedTabWidth === 'auto';\n const scrollOffset = getScrollAmount({\n layout,\n navigationState,\n tabWidths,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n\n const hasMeasuredTabWidths =\n Boolean(layout.width) &&\n routes\n .slice(0, navigationState.index)\n .every((r) => typeof tabWidths[r.key] === 'number');\n\n React.useEffect(() => {\n if (isFirst.current) {\n isFirst.current = false;\n return;\n }\n\n if (isWidthDynamic && !hasMeasuredTabWidths) {\n return;\n }\n\n if (scrollEnabled) {\n flatListRef.current?.scrollToOffset({\n offset: scrollOffset,\n animated: true,\n });\n }\n }, [hasMeasuredTabWidths, isWidthDynamic, scrollEnabled, scrollOffset]);\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n setLayout((layout) =>\n layout.width === width && layout.height === height\n ? layout\n : { width, height }\n );\n };\n\n const tabBarWidth = getTabBarWidth({\n layout,\n navigationState,\n tabWidths,\n gap,\n scrollEnabled,\n flattenedTabWidth,\n });\n\n const separatorsWidth = Math.max(0, routes.length - 1) * gap;\n const separatorPercent = (separatorsWidth / tabBarWidth) * 100;\n const tabBarWidthPercent = `${routes.length * 40}%`;\n\n const translateX = React.useMemo(\n () =>\n getTranslateX(\n scrollAmount,\n getMaxScrollDistance(tabBarWidth, layout.width)\n ),\n [layout.width, scrollAmount, tabBarWidth]\n );\n\n const renderItem = React.useCallback(\n ({ item: route, index }: ListRenderItemInfo<T>) => {\n const props: TabBarItemProps<T> & { key: string } = {\n key: route.key,\n position: position,\n route: route,\n navigationState: navigationState,\n getAccessibilityLabel: getAccessibilityLabel,\n getAccessible: getAccessible,\n getLabelText: getLabelText,\n getTestID: getTestID,\n renderBadge: renderBadge,\n renderIcon: renderIcon,\n renderLabel: renderLabel,\n activeColor: activeColor,\n inactiveColor: inactiveColor,\n pressColor: pressColor,\n pressOpacity: pressOpacity,\n onLayout: isWidthDynamic\n ? (e: LayoutChangeEvent) => {\n measuredTabWidths.current[route.key] = e.nativeEvent.layout.width;\n\n // When we have measured widths for all of the tabs, we should updates the state\n // We avoid doing separate setState for each layout since it triggers multiple renders and slows down app\n // If we have more than 10 routes divide updating tabWidths into multiple batches. Here we update only first batch of 10 items.\n if (\n routes.length > MEASURE_PER_BATCH &&\n index === MEASURE_PER_BATCH &&\n routes\n .slice(0, MEASURE_PER_BATCH)\n .every(\n (r) => typeof measuredTabWidths.current[r.key] === 'number'\n )\n ) {\n setTabWidths({ ...measuredTabWidths.current });\n } else if (\n routes.every(\n (r) => typeof measuredTabWidths.current[r.key] === 'number'\n )\n ) {\n // When we have measured widths for all of the tabs, we should updates the state\n // We avoid doing separate setState for each layout since it triggers multiple renders and slows down app\n setTabWidths({ ...measuredTabWidths.current });\n }\n }\n : undefined,\n onPress: () => {\n const event: Scene<T> & Event = {\n route,\n defaultPrevented: false,\n preventDefault: () => {\n event.defaultPrevented = true;\n },\n };\n\n onTabPress?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n jumpTo(route.key);\n },\n onLongPress: () => onTabLongPress?.({ route }),\n labelStyle: labelStyle,\n style: tabStyle,\n // Calculate the deafult width for tab for FlatList to work\n defaultTabWidth: !isWidthDynamic\n ? getComputedTabWidth(\n index,\n layout,\n routes,\n scrollEnabled,\n tabWidths,\n getFlattenedTabWidth(tabStyle)\n )\n : undefined,\n };\n\n return (\n <>\n {gap > 0 && index > 0 ? <Separator width={gap} /> : null}\n {renderTabBarItem ? (\n renderTabBarItem(props)\n ) : (\n <TabBarItem {...props} />\n )}\n </>\n );\n },\n [\n activeColor,\n gap,\n getAccessibilityLabel,\n getAccessible,\n getLabelText,\n getTestID,\n inactiveColor,\n isWidthDynamic,\n jumpTo,\n labelStyle,\n layout,\n navigationState,\n onTabLongPress,\n onTabPress,\n position,\n pressColor,\n pressOpacity,\n renderBadge,\n renderIcon,\n renderLabel,\n renderTabBarItem,\n routes,\n scrollEnabled,\n tabStyle,\n tabWidths,\n ]\n );\n\n const keyExtractor = React.useCallback((item: T) => item.key, []);\n\n const contentContainerStyleMemoized = React.useMemo(\n () => [\n styles.tabContent,\n scrollEnabled\n ? {\n width:\n tabBarWidth > separatorsWidth ? tabBarWidth : tabBarWidthPercent,\n }\n : styles.container,\n contentContainerStyle,\n ],\n [\n contentContainerStyle,\n scrollEnabled,\n separatorsWidth,\n tabBarWidth,\n tabBarWidthPercent,\n ]\n );\n\n const handleScroll = React.useMemo(\n () =>\n Animated.event(\n [\n {\n nativeEvent: {\n contentOffset: { x: scrollAmount },\n },\n },\n ],\n { useNativeDriver: true }\n ),\n [scrollAmount]\n );\n\n const handleViewableItemsChanged = useLatestCallback(\n ({ changed }: { changed: ViewToken[] }) => {\n if (routes.length <= MEASURE_PER_BATCH) {\n return;\n }\n // Get next vievable item\n const item = changed[changed.length - 1];\n const index = item?.index || 0;\n if (\n item.isViewable &&\n (index % 10 === 0 ||\n index === navigationState.index ||\n index === routes.length - 1)\n ) {\n setTabWidths({ ...measuredTabWidths.current });\n }\n }\n );\n\n return (\n <Animated.View onLayout={handleLayout} style={[styles.tabBar, style]}>\n <Animated.View\n pointerEvents=\"none\"\n style={[\n styles.indicatorContainer,\n scrollEnabled ? { transform: [{ translateX }] as any } : null,\n tabBarWidth > separatorsWidth\n ? { width: tabBarWidth - separatorsWidth }\n : scrollEnabled\n ? { width: tabBarWidthPercent }\n : null,\n indicatorContainerStyle,\n ]}\n >\n {renderIndicator({\n position,\n layout,\n navigationState,\n jumpTo,\n width: isWidthDynamic\n ? 'auto'\n : `${(100 - separatorPercent) / routes.length}%`,\n style: indicatorStyle,\n getTabWidth: (i: number) =>\n getComputedTabWidth(\n i,\n layout,\n routes,\n scrollEnabled,\n tabWidths,\n flattenedTabWidth\n ),\n gap,\n })}\n </Animated.View>\n <View style={styles.scroll}>\n <Animated.FlatList\n data={routes as Animated.WithAnimatedValue<T>[]}\n keyExtractor={keyExtractor}\n horizontal\n accessibilityRole=\"tablist\"\n keyboardShouldPersistTaps=\"handled\"\n scrollEnabled={scrollEnabled}\n bounces={bounces}\n initialNumToRender={MEASURE_PER_BATCH}\n onViewableItemsChanged={handleViewableItemsChanged}\n alwaysBounceHorizontal={false}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n automaticallyAdjustContentInsets={false}\n overScrollMode=\"never\"\n contentContainerStyle={contentContainerStyleMemoized}\n scrollEventThrottle={16}\n renderItem={renderItem}\n onScroll={handleScroll}\n ref={flatListRef}\n testID={testID}\n />\n </View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n scroll: {\n overflow: Platform.select({ default: 'scroll', web: undefined }),\n },\n tabBar: {\n backgroundColor: '#2196f3',\n elevation: 4,\n shadowColor: 'black',\n shadowOpacity: 0.1,\n shadowRadius: StyleSheet.hairlineWidth,\n shadowOffset: {\n height: StyleSheet.hairlineWidth,\n width: 0,\n },\n zIndex: 1,\n },\n tabContent: {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n },\n indicatorContainer: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAGEC,WAHF,EAMEC,QANF,EAQEC,UARF,EAUEC,IAVF,QAaO,cAbP;AAcA,OAAOC,iBAAP,MAA8B,qBAA9B;AAEA,OAAOC,eAAP,MAAyD,mBAAzD;AACA,OAAOC,UAAP,MAAqD,cAArD;AASA,OAAOC,gBAAP,MAA6B,oBAA7B;;AA6CA,MAAMC,SA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YAAY,EAAE;MACZjE,MAAM,EAAE9F,UAAU,CAAC8J,aADP;MAEZvJ,KAAK,EAAE;IAFK,CANR;IAUNyJ,MAAM,EAAE;EAVF,CAPuB;EAmB/B3B,UAAU,EAAE;IACV4B,aAAa,EAAE,KADL;IAEVC,QAAQ,EAAE;EAFA,CAnBmB;EAuB/BnB,kBAAkB,EAAE;IAClBnE,QAAQ,EAAE,UADQ;IAElBuF,GAAG,EAAE,CAFa;IAGlBC,IAAI,EAAE,CAHY;IAIlBC,KAAK,EAAE,CAJW;IAKlBC,MAAM,EAAE;EALU;AAvBW,CAAlB,CAAf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Animated, Easing,
|
|
2
|
+
import { Animated, Easing, I18nManager, Platform, StyleSheet } from 'react-native';
|
|
3
3
|
import useAnimatedValue from './useAnimatedValue';
|
|
4
4
|
|
|
5
5
|
const getTranslateX = (position, routes, getTabWidth, gap) => {
|
|
@@ -7,7 +7,7 @@ const getTranslateX = (position, routes, getTabWidth, gap) => {
|
|
|
7
7
|
|
|
8
8
|
const outputRange = routes.reduce((acc, _, i) => {
|
|
9
9
|
if (i === 0) return [0];
|
|
10
|
-
return [...acc, acc[i - 1] + getTabWidth(i - 1) + (gap
|
|
10
|
+
return [...acc, acc[i - 1] + getTabWidth(i - 1) + (gap !== null && gap !== void 0 ? gap : 0)];
|
|
11
11
|
}, []);
|
|
12
12
|
const translateX = position.interpolate({
|
|
13
13
|
inputRange,
|
|
@@ -30,11 +30,11 @@ export default function TabBarIndicator(_ref) {
|
|
|
30
30
|
const isIndicatorShown = React.useRef(false);
|
|
31
31
|
const isWidthDynamic = width === 'auto';
|
|
32
32
|
const opacity = useAnimatedValue(isWidthDynamic ? 0 : 1);
|
|
33
|
-
const
|
|
33
|
+
const indicatorVisible = isWidthDynamic ? layout.width && navigationState.routes.slice(0, navigationState.index).every((_, r) => getTabWidth(r)) : true;
|
|
34
34
|
React.useEffect(() => {
|
|
35
35
|
const fadeInIndicator = () => {
|
|
36
36
|
if (!isIndicatorShown.current && isWidthDynamic && // We should fade-in the indicator when we have widths for all the tab items
|
|
37
|
-
|
|
37
|
+
indicatorVisible) {
|
|
38
38
|
isIndicatorShown.current = true;
|
|
39
39
|
Animated.timing(opacity, {
|
|
40
40
|
toValue: 1,
|
|
@@ -47,7 +47,7 @@ export default function TabBarIndicator(_ref) {
|
|
|
47
47
|
|
|
48
48
|
fadeInIndicator();
|
|
49
49
|
return () => opacity.stopAnimation();
|
|
50
|
-
}, [
|
|
50
|
+
}, [indicatorVisible, isWidthDynamic, opacity]);
|
|
51
51
|
const {
|
|
52
52
|
routes
|
|
53
53
|
} = navigationState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Animated","Easing","
|
|
1
|
+
{"version":3,"names":["React","Animated","Easing","I18nManager","Platform","StyleSheet","useAnimatedValue","getTranslateX","position","routes","getTabWidth","gap","inputRange","map","_","i","outputRange","reduce","acc","translateX","interpolate","extrapolate","multiply","isRTL","TabBarIndicator","layout","navigationState","width","style","isIndicatorShown","useRef","isWidthDynamic","opacity","indicatorVisible","slice","index","every","r","useEffect","fadeInIndicator","current","timing","toValue","duration","easing","in","linear","useNativeDriver","start","stopAnimation","transform","length","push","scaleX","styles","indicator","OS","left","create","backgroundColor","bottom","right","height"],"sources":["TabBarIndicator.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n Easing,\n I18nManager,\n Platform,\n StyleProp,\n StyleSheet,\n ViewStyle,\n} from 'react-native';\n\nimport type { NavigationState, Route, SceneRendererProps } from './types';\nimport useAnimatedValue from './useAnimatedValue';\n\nexport type GetTabWidth = (index: number) => number;\n\nexport type Props<T extends Route> = SceneRendererProps & {\n navigationState: NavigationState<T>;\n width: string | number;\n style?: StyleProp<ViewStyle>;\n getTabWidth: GetTabWidth;\n gap?: number;\n};\n\nconst getTranslateX = (\n position: Animated.AnimatedInterpolation,\n routes: Route[],\n getTabWidth: GetTabWidth,\n gap?: number\n) => {\n const inputRange = routes.map((_, i) => i);\n\n // every index contains widths at all previous indices\n const outputRange = routes.reduce<number[]>((acc, _, i) => {\n if (i === 0) return [0];\n return [...acc, acc[i - 1] + getTabWidth(i - 1) + (gap ?? 0)];\n }, []);\n\n const translateX = position.interpolate({\n inputRange,\n outputRange,\n extrapolate: 'clamp',\n });\n\n return Animated.multiply(translateX, I18nManager.isRTL ? -1 : 1);\n};\n\nexport default function TabBarIndicator<T extends Route>({\n getTabWidth,\n layout,\n navigationState,\n position,\n width,\n gap,\n style,\n}: Props<T>) {\n const isIndicatorShown = React.useRef(false);\n const isWidthDynamic = width === 'auto';\n\n const opacity = useAnimatedValue(isWidthDynamic ? 0 : 1);\n\n const indicatorVisible = isWidthDynamic\n ? layout.width &&\n navigationState.routes\n .slice(0, navigationState.index)\n .every((_, r) => getTabWidth(r))\n : true;\n\n React.useEffect(() => {\n const fadeInIndicator = () => {\n if (\n !isIndicatorShown.current &&\n isWidthDynamic &&\n // We should fade-in the indicator when we have widths for all the tab items\n indicatorVisible\n ) {\n isIndicatorShown.current = true;\n\n Animated.timing(opacity, {\n toValue: 1,\n duration: 150,\n easing: Easing.in(Easing.linear),\n useNativeDriver: true,\n }).start();\n }\n };\n\n fadeInIndicator();\n\n return () => opacity.stopAnimation();\n }, [indicatorVisible, isWidthDynamic, opacity]);\n\n const { routes } = navigationState;\n\n const transform = [];\n\n if (layout.width) {\n const translateX =\n routes.length > 1 ? getTranslateX(position, routes, getTabWidth, gap) : 0;\n\n transform.push({ translateX });\n }\n\n if (width === 'auto') {\n const inputRange = routes.map((_, i) => i);\n const outputRange = inputRange.map(getTabWidth);\n\n transform.push(\n {\n scaleX:\n routes.length > 1\n ? position.interpolate({\n inputRange,\n outputRange,\n extrapolate: 'clamp',\n })\n : outputRange[0],\n },\n { translateX: 0.5 }\n );\n }\n\n return (\n <Animated.View\n style={[\n styles.indicator,\n { width: width === 'auto' ? 1 : width },\n // If layout is not available, use `left` property for positioning the indicator\n // This avoids rendering delay until we are able to calculate translateX\n // If platform is macos use `left` property as `transform` is broken at the moment.\n // See: https://github.com/microsoft/react-native-macos/issues/280\n layout.width && Platform.OS !== 'macos'\n ? { left: 0 }\n : { left: `${(100 / routes.length) * navigationState.index}%` },\n { transform },\n width === 'auto' ? { opacity: opacity } : null,\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n indicator: {\n backgroundColor: '#ffeb3b',\n position: 'absolute',\n left: 0,\n bottom: 0,\n right: 0,\n height: 2,\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,MAFF,EAGEC,WAHF,EAIEC,QAJF,EAMEC,UANF,QAQO,cARP;AAWA,OAAOC,gBAAP,MAA6B,oBAA7B;;AAYA,MAAMC,aAAa,GAAG,CACpBC,QADoB,EAEpBC,MAFoB,EAGpBC,WAHoB,EAIpBC,GAJoB,KAKjB;EACH,MAAMC,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,CAACC,CAAD,EAAIC,CAAJ,KAAUA,CAArB,CAAnB,CADG,CAGH;;EACA,MAAMC,WAAW,GAAGP,MAAM,CAACQ,MAAP,CAAwB,CAACC,GAAD,EAAMJ,CAAN,EAASC,CAAT,KAAe;IACzD,IAAIA,CAAC,KAAK,CAAV,EAAa,OAAO,CAAC,CAAD,CAAP;IACb,OAAO,CAAC,GAAGG,GAAJ,EAASA,GAAG,CAACH,CAAC,GAAG,CAAL,CAAH,GAAaL,WAAW,CAACK,CAAC,GAAG,CAAL,CAAxB,IAAmCJ,GAAnC,aAAmCA,GAAnC,cAAmCA,GAAnC,GAA0C,CAA1C,CAAT,CAAP;EACD,CAHmB,EAGjB,EAHiB,CAApB;EAKA,MAAMQ,UAAU,GAAGX,QAAQ,CAACY,WAAT,CAAqB;IACtCR,UADsC;IAEtCI,WAFsC;IAGtCK,WAAW,EAAE;EAHyB,CAArB,CAAnB;EAMA,OAAOpB,QAAQ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MAAEe;IAAF,CAVK,EAWLvB,KAAK,KAAK,MAAV,GAAmB;MAAEK,OAAO,EAAEA;IAAX,CAAnB,GAA0C,IAXrC,EAYLJ,KAZK;EADT,EADF;AAkBD;AAED,MAAM0B,MAAM,GAAGjD,UAAU,CAACqD,MAAX,CAAkB;EAC/BH,SAAS,EAAE;IACTI,eAAe,EAAE,SADR;IAETnD,QAAQ,EAAE,UAFD;IAGTiD,IAAI,EAAE,CAHG;IAITG,MAAM,EAAE,CAJC;IAKTC,KAAK,EAAE,CALE;IAMTC,MAAM,EAAE;EANC;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Animated","StyleSheet","View","useLatestCallback","PlatformPressable","DEFAULT_ACTIVE_COLOR","DEFAULT_INACTIVE_COLOR","getActiveOpacity","position","routesLength","tabIndex","inputRange","Array","from","length","_","i","interpolate","outputRange","map","getInactiveOpacity","TabBarItemInternal","getAccessibilityLabel","getAccessible","getLabelText","getTestID","onLongPress","onPress","isFocused","route","style","inactiveColor","inactiveColorCustom","activeColor","activeColorCustom","labelStyle","onLayout","index","pressColor","pressOpacity","renderBadge","renderIcon","defaultTabWidth","renderLabel","renderLabelCustom","labelColorFromStyle","flatten","color","undefined","activeOpacity","inactiveOpacity","icon","label","activeIcon","focused","inactiveIcon","styles","opacity","absoluteFill","labelProps","labelText","marginTop","activeLabel","inactiveLabel","tabStyle","isWidthSet","width","tabContainerStyle","scene","accessibilityLabel","badge","borderless","selected","pressable","item","MemoizedTabBarItemInternal","memo","TabBarItem","props","navigationState","rest","onPressLatest","onLongPressLatest","onLayoutLatest","routes","indexOf","create","margin","backgroundColor","textTransform","flex","alignItems","justifyContent","padding","minHeight","top","right"],"sources":["TabBarItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n StyleSheet,\n View,\n StyleProp,\n LayoutChangeEvent,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport useLatestCallback from 'use-latest-callback';\nimport PlatformPressable from './PlatformPressable';\nimport type { Scene, Route, NavigationState } from './types';\n\nexport type Props<T extends Route> = {\n position: Animated.AnimatedInterpolation;\n route: T;\n navigationState: NavigationState<T>;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n getLabelText: (scene: Scene<T>) => string | undefined;\n getAccessible: (scene: Scene<T>) => boolean | undefined;\n getAccessibilityLabel: (scene: Scene<T>) => string | undefined;\n getTestID: (scene: Scene<T>) => string | undefined;\n renderLabel?: (scene: {\n route: T;\n focused: boolean;\n color: string;\n }) => React.ReactNode;\n renderIcon?: (scene: {\n route: T;\n focused: boolean;\n color: string;\n }) => React.ReactNode;\n renderBadge?: (scene: Scene<T>) => React.ReactNode;\n onLayout?: (event: LayoutChangeEvent) => void;\n onPress: () => void;\n onLongPress: () => void;\n defaultTabWidth?: number;\n labelStyle?: StyleProp<TextStyle>;\n style: StyleProp<ViewStyle>;\n};\n\nconst DEFAULT_ACTIVE_COLOR = 'rgba(255, 255, 255, 1)';\nconst DEFAULT_INACTIVE_COLOR = 'rgba(255, 255, 255, 0.7)';\n\nconst getActiveOpacity = (\n position: Animated.AnimatedInterpolation,\n routesLength: number,\n tabIndex: number\n) => {\n if (routesLength > 1) {\n const inputRange = Array.from({ length: routesLength }, (_, i) => i);\n\n return position.interpolate({\n inputRange,\n outputRange: inputRange.map((i) => (i === tabIndex ? 1 : 0)),\n });\n } else {\n return 1;\n }\n};\n\nconst getInactiveOpacity = (\n position: Animated.AnimatedInterpolation,\n routesLength: number,\n tabIndex: number\n) => {\n if (routesLength > 1) {\n const inputRange = Array.from({ length: routesLength }, (_, i) => i);\n\n return position.interpolate({\n inputRange,\n outputRange: inputRange.map((i: number) => (i === tabIndex ? 0 : 1)),\n });\n } else {\n return 0;\n }\n};\n\ntype TabBarItemInternalProps<T extends Route> = Omit<\n Props<T>,\n 'navigationState'\n> & {\n isFocused: boolean;\n index: number;\n routesLength: number;\n};\n\nconst TabBarItemInternal = <T extends Route>({\n getAccessibilityLabel,\n getAccessible,\n getLabelText,\n getTestID,\n onLongPress,\n onPress,\n isFocused,\n position,\n route,\n style,\n inactiveColor: inactiveColorCustom,\n activeColor: activeColorCustom,\n labelStyle,\n onLayout,\n index: tabIndex,\n pressColor,\n pressOpacity,\n renderBadge,\n renderIcon,\n defaultTabWidth,\n routesLength,\n renderLabel: renderLabelCustom,\n}: TabBarItemInternalProps<T>) => {\n const labelColorFromStyle = StyleSheet.flatten(labelStyle || {}).color;\n\n const activeColor =\n activeColorCustom !== undefined\n ? activeColorCustom\n : typeof labelColorFromStyle === 'string'\n ? labelColorFromStyle\n : DEFAULT_ACTIVE_COLOR;\n const inactiveColor =\n inactiveColorCustom !== undefined\n ? inactiveColorCustom\n : typeof labelColorFromStyle === 'string'\n ? labelColorFromStyle\n : DEFAULT_INACTIVE_COLOR;\n\n const activeOpacity = getActiveOpacity(position, routesLength, tabIndex);\n const inactiveOpacity = getInactiveOpacity(position, routesLength, tabIndex);\n\n let icon: React.ReactNode | null = null;\n let label: React.ReactNode | null = null;\n\n if (renderIcon) {\n const activeIcon = renderIcon({\n route,\n focused: true,\n color: activeColor,\n });\n const inactiveIcon = renderIcon({\n route,\n focused: false,\n color: inactiveColor,\n });\n\n if (inactiveIcon != null && activeIcon != null) {\n icon = (\n <View style={styles.icon}>\n <Animated.View style={{ opacity: inactiveOpacity }}>\n {inactiveIcon}\n </Animated.View>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: activeOpacity }]}\n >\n {activeIcon}\n </Animated.View>\n </View>\n );\n }\n }\n\n const renderLabel =\n renderLabelCustom !== undefined\n ? renderLabelCustom\n : (labelProps: { route: T; color: string }) => {\n const labelText = getLabelText({ route: labelProps.route });\n\n if (typeof labelText === 'string') {\n return (\n <Animated.Text\n style={[\n styles.label,\n icon ? { marginTop: 0 } : null,\n labelStyle,\n { color: labelProps.color },\n ]}\n >\n {labelText}\n </Animated.Text>\n );\n }\n\n return labelText;\n };\n\n if (renderLabel) {\n const activeLabel = renderLabel({\n route,\n focused: true,\n color: activeColor,\n });\n const inactiveLabel = renderLabel({\n route,\n focused: false,\n color: inactiveColor,\n });\n\n label = (\n <View>\n <Animated.View style={{ opacity: inactiveOpacity }}>\n {inactiveLabel}\n </Animated.View>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: activeOpacity }]}\n >\n {activeLabel}\n </Animated.View>\n </View>\n );\n }\n\n const tabStyle = StyleSheet.flatten(style);\n const isWidthSet = tabStyle?.width !== undefined;\n\n const tabContainerStyle: ViewStyle | null = isWidthSet\n ? null\n : { width: defaultTabWidth };\n\n const scene = { route };\n\n let accessibilityLabel = getAccessibilityLabel(scene);\n\n accessibilityLabel =\n typeof accessibilityLabel !== 'undefined'\n ? accessibilityLabel\n : getLabelText(scene);\n\n const badge = renderBadge ? renderBadge(scene) : null;\n\n return (\n <PlatformPressable\n android_ripple={{ borderless: true }}\n testID={getTestID(scene)}\n accessible={getAccessible(scene)}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: isFocused }}\n // @ts-ignore: this is to support older React Native versions\n accessibilityStates={isFocused ? ['selected'] : []}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n delayPressIn={0}\n onLayout={onLayout}\n onPress={onPress}\n onLongPress={onLongPress}\n style={[styles.pressable, tabContainerStyle]}\n >\n <View pointerEvents=\"none\" style={[styles.item, tabStyle]}>\n {icon}\n {label}\n {badge != null ? <View style={styles.badge}>{badge}</View> : null}\n </View>\n </PlatformPressable>\n );\n};\n\nconst MemoizedTabBarItemInternal = React.memo(\n TabBarItemInternal\n) as typeof TabBarItemInternal;\n\nfunction TabBarItem<T extends Route>(props: Props<T>) {\n const { onPress, onLongPress, onLayout, navigationState, route, ...rest } =\n props;\n const onPressLatest = useLatestCallback(onPress);\n const onLongPressLatest = useLatestCallback(onLongPress);\n const onLayoutLatest = useLatestCallback(onLayout ? onLayout : () => {});\n\n const tabIndex = navigationState.routes.indexOf(route);\n\n return (\n <MemoizedTabBarItemInternal\n {...rest}\n onPress={onPressLatest}\n onLayout={onLayoutLatest}\n onLongPress={onLongPressLatest}\n isFocused={navigationState.index === tabIndex}\n route={route}\n index={tabIndex}\n routesLength={navigationState.routes.length}\n />\n );\n}\n\nexport default TabBarItem;\n\nconst styles = StyleSheet.create({\n label: {\n margin: 4,\n backgroundColor: 'transparent',\n textTransform: 'uppercase',\n },\n icon: {\n margin: 2,\n },\n item: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: 10,\n minHeight: 48,\n },\n badge: {\n position: 'absolute',\n top: 0,\n right: 0,\n },\n pressable: {\n // The label is not pressable on Windows\n // Adding backgroundColor: 'transparent' seems to fix it\n backgroundColor: 'transparent',\n },\n});\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,UAFF,EAGEC,IAHF,QAQO,cARP;AASA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AAkCA,MAAMC,oBAAoB,GAAG,wBAA7B;AACA,MAAMC,sBAAsB,GAAG,0BAA/B;;AAEA,MAAMC,gBAAgB,GAAG,CACvBC,QADuB,EAEvBC,YAFuB,EAGvBC,QAHuB,KAIpB;EACH,IAAID,YAAY,GAAG,CAAnB,EAAsB;IACpB,MAAME,UAAU,GAAGC,KAAK,CAACC,IAAN,CAAW;MAAEC,MAAM,EAAEL;IAAV,CAAX,EAAqC,CAACM,CAAD,EAAIC,CAAJ,KAAUA,CAA/C,CAAnB;IAEA,OAAOR,QAAQ,CAACS,WAAT,CAAqB;MAC1BN,UAD0B;MAE1BO,WAAW,EAAEP,UAAU,CAACQ,GAAX,CAAgBH,CAAD,IAAQA,CAAC,KAAKN,QAAN,GAAiB,CAAjB,GAAqB,CAA5C;IAFa,CAArB,CAAP;EAID,CAPD,MAOO;IACL,OAAO,CAAP;EACD;AACF,CAfD;;AAiBA,MAAMU,kBAAkB,GAAG,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ACTIVE_COLOR","DEFAULT_INACTIVE_COLOR","getActiveOpacity","position","routesLength","tabIndex","inputRange","Array","from","length","_","i","interpolate","outputRange","map","getInactiveOpacity","TabBarItemInternal","getAccessibilityLabel","getAccessible","getLabelText","getTestID","onLongPress","onPress","isFocused","route","style","inactiveColor","inactiveColorCustom","activeColor","activeColorCustom","labelStyle","onLayout","index","pressColor","pressOpacity","renderBadge","renderIcon","defaultTabWidth","renderLabel","renderLabelCustom","labelColorFromStyle","flatten","color","undefined","activeOpacity","inactiveOpacity","icon","label","activeIcon","focused","inactiveIcon","styles","opacity","absoluteFill","labelProps","labelText","marginTop","activeLabel","inactiveLabel","tabStyle","isWidthSet","width","tabContainerStyle","scene","accessibilityLabel","badge","borderless","selected","pressable","item","MemoizedTabBarItemInternal","memo","TabBarItem","props","navigationState","rest","onPressLatest","onLongPressLatest","onLayoutLatest","routes","indexOf","create","margin","backgroundColor","textTransform","flex","alignItems","justifyContent","padding","minHeight","top","right"],"sources":["TabBarItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n StyleProp,\n StyleSheet,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native';\nimport useLatestCallback from 'use-latest-callback';\n\nimport PlatformPressable from './PlatformPressable';\nimport type { NavigationState, Route, Scene } from './types';\n\nexport type Props<T extends Route> = {\n position: Animated.AnimatedInterpolation;\n route: T;\n navigationState: NavigationState<T>;\n activeColor?: string;\n inactiveColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n getLabelText: (scene: Scene<T>) => string | undefined;\n getAccessible: (scene: Scene<T>) => boolean | undefined;\n getAccessibilityLabel: (scene: Scene<T>) => string | undefined;\n getTestID: (scene: Scene<T>) => string | undefined;\n renderLabel?: (scene: {\n route: T;\n focused: boolean;\n color: string;\n }) => React.ReactNode;\n renderIcon?: (scene: {\n route: T;\n focused: boolean;\n color: string;\n }) => React.ReactNode;\n renderBadge?: (scene: Scene<T>) => React.ReactNode;\n onLayout?: (event: LayoutChangeEvent) => void;\n onPress: () => void;\n onLongPress: () => void;\n defaultTabWidth?: number;\n labelStyle?: StyleProp<TextStyle>;\n style: StyleProp<ViewStyle>;\n};\n\nconst DEFAULT_ACTIVE_COLOR = 'rgba(255, 255, 255, 1)';\nconst DEFAULT_INACTIVE_COLOR = 'rgba(255, 255, 255, 0.7)';\n\nconst getActiveOpacity = (\n position: Animated.AnimatedInterpolation,\n routesLength: number,\n tabIndex: number\n) => {\n if (routesLength > 1) {\n const inputRange = Array.from({ length: routesLength }, (_, i) => i);\n\n return position.interpolate({\n inputRange,\n outputRange: inputRange.map((i) => (i === tabIndex ? 1 : 0)),\n });\n } else {\n return 1;\n }\n};\n\nconst getInactiveOpacity = (\n position: Animated.AnimatedInterpolation,\n routesLength: number,\n tabIndex: number\n) => {\n if (routesLength > 1) {\n const inputRange = Array.from({ length: routesLength }, (_, i) => i);\n\n return position.interpolate({\n inputRange,\n outputRange: inputRange.map((i: number) => (i === tabIndex ? 0 : 1)),\n });\n } else {\n return 0;\n }\n};\n\ntype TabBarItemInternalProps<T extends Route> = Omit<\n Props<T>,\n 'navigationState'\n> & {\n isFocused: boolean;\n index: number;\n routesLength: number;\n};\n\nconst TabBarItemInternal = <T extends Route>({\n getAccessibilityLabel,\n getAccessible,\n getLabelText,\n getTestID,\n onLongPress,\n onPress,\n isFocused,\n position,\n route,\n style,\n inactiveColor: inactiveColorCustom,\n activeColor: activeColorCustom,\n labelStyle,\n onLayout,\n index: tabIndex,\n pressColor,\n pressOpacity,\n renderBadge,\n renderIcon,\n defaultTabWidth,\n routesLength,\n renderLabel: renderLabelCustom,\n}: TabBarItemInternalProps<T>) => {\n const labelColorFromStyle = StyleSheet.flatten(labelStyle || {}).color;\n\n const activeColor =\n activeColorCustom !== undefined\n ? activeColorCustom\n : typeof labelColorFromStyle === 'string'\n ? labelColorFromStyle\n : DEFAULT_ACTIVE_COLOR;\n const inactiveColor =\n inactiveColorCustom !== undefined\n ? inactiveColorCustom\n : typeof labelColorFromStyle === 'string'\n ? labelColorFromStyle\n : DEFAULT_INACTIVE_COLOR;\n\n const activeOpacity = getActiveOpacity(position, routesLength, tabIndex);\n const inactiveOpacity = getInactiveOpacity(position, routesLength, tabIndex);\n\n let icon: React.ReactNode | null = null;\n let label: React.ReactNode | null = null;\n\n if (renderIcon) {\n const activeIcon = renderIcon({\n route,\n focused: true,\n color: activeColor,\n });\n const inactiveIcon = renderIcon({\n route,\n focused: false,\n color: inactiveColor,\n });\n\n if (inactiveIcon != null && activeIcon != null) {\n icon = (\n <View style={styles.icon}>\n <Animated.View style={{ opacity: inactiveOpacity }}>\n {inactiveIcon}\n </Animated.View>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: activeOpacity }]}\n >\n {activeIcon}\n </Animated.View>\n </View>\n );\n }\n }\n\n const renderLabel =\n renderLabelCustom !== undefined\n ? renderLabelCustom\n : (labelProps: { route: T; color: string }) => {\n const labelText = getLabelText({ route: labelProps.route });\n\n if (typeof labelText === 'string') {\n return (\n <Animated.Text\n style={[\n styles.label,\n icon ? { marginTop: 0 } : null,\n labelStyle,\n { color: labelProps.color },\n ]}\n >\n {labelText}\n </Animated.Text>\n );\n }\n\n return labelText;\n };\n\n if (renderLabel) {\n const activeLabel = renderLabel({\n route,\n focused: true,\n color: activeColor,\n });\n const inactiveLabel = renderLabel({\n route,\n focused: false,\n color: inactiveColor,\n });\n\n label = (\n <View>\n <Animated.View style={{ opacity: inactiveOpacity }}>\n {inactiveLabel}\n </Animated.View>\n <Animated.View\n style={[StyleSheet.absoluteFill, { opacity: activeOpacity }]}\n >\n {activeLabel}\n </Animated.View>\n </View>\n );\n }\n\n const tabStyle = StyleSheet.flatten(style);\n const isWidthSet = tabStyle?.width !== undefined;\n\n const tabContainerStyle: ViewStyle | null = isWidthSet\n ? null\n : { width: defaultTabWidth };\n\n const scene = { route };\n\n let accessibilityLabel = getAccessibilityLabel(scene);\n\n accessibilityLabel =\n typeof accessibilityLabel !== 'undefined'\n ? accessibilityLabel\n : getLabelText(scene);\n\n const badge = renderBadge ? renderBadge(scene) : null;\n\n return (\n <PlatformPressable\n android_ripple={{ borderless: true }}\n testID={getTestID(scene)}\n accessible={getAccessible(scene)}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: isFocused }}\n // @ts-ignore: this is to support older React Native versions\n accessibilityStates={isFocused ? ['selected'] : []}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n delayPressIn={0}\n onLayout={onLayout}\n onPress={onPress}\n onLongPress={onLongPress}\n style={[styles.pressable, tabContainerStyle]}\n >\n <View pointerEvents=\"none\" style={[styles.item, tabStyle]}>\n {icon}\n {label}\n {badge != null ? <View style={styles.badge}>{badge}</View> : null}\n </View>\n </PlatformPressable>\n );\n};\n\nconst MemoizedTabBarItemInternal = React.memo(\n TabBarItemInternal\n) as typeof TabBarItemInternal;\n\nfunction TabBarItem<T extends Route>(props: Props<T>) {\n const { onPress, onLongPress, onLayout, navigationState, route, ...rest } =\n props;\n const onPressLatest = useLatestCallback(onPress);\n const onLongPressLatest = useLatestCallback(onLongPress);\n const onLayoutLatest = useLatestCallback(onLayout ? onLayout : () => {});\n\n const tabIndex = navigationState.routes.indexOf(route);\n\n return (\n <MemoizedTabBarItemInternal\n {...rest}\n onPress={onPressLatest}\n onLayout={onLayoutLatest}\n onLongPress={onLongPressLatest}\n isFocused={navigationState.index === tabIndex}\n route={route}\n index={tabIndex}\n routesLength={navigationState.routes.length}\n />\n );\n}\n\nexport default TabBarItem;\n\nconst styles = StyleSheet.create({\n label: {\n margin: 4,\n backgroundColor: 'transparent',\n textTransform: 'uppercase',\n },\n icon: {\n margin: 2,\n },\n item: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n padding: 10,\n minHeight: 48,\n },\n badge: {\n position: 'absolute',\n top: 0,\n right: 0,\n },\n pressable: {\n // The label is not pressable on Windows\n // Adding backgroundColor: 'transparent' seems to fix it\n backgroundColor: 'transparent',\n },\n});\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3B,QALvC;IAME,KAAK,EAAEmB,KANT;IAOE,KAAK,EAAEnB,QAPT;IAQE,YAAY,EAAEqE,eAAe,CAACK,MAAhB,CAAuBtE;EARvC,GADF;AAYD;;AAED,eAAe+D,UAAf;AAEA,MAAMrB,MAAM,GAAGvD,UAAU,CAACqF,MAAX,CAAkB;EAC/BlC,KAAK,EAAE;IACLmC,MAAM,EAAE,CADH;IAELC,eAAe,EAAE,aAFZ;IAGLC,aAAa,EAAE;EAHV,CADwB;EAM/BtC,IAAI,EAAE;IACJoC,MAAM,EAAE;EADJ,CANyB;EAS/Bb,IAAI,EAAE;IACJgB,IAAI,EAAE,CADF;IAEJC,UAAU,EAAE,QAFR;IAGJC,cAAc,EAAE,QAHZ;IAIJC,OAAO,EAAE,EAJL;IAKJC,SAAS,EAAE;EALP,CATyB;EAgB/BxB,KAAK,EAAE;IACL9D,QAAQ,EAAE,UADL;IAELuF,GAAG,EAAE,CAFA;IAGLC,KAAK,EAAE;EAHF,CAhBwB;EAqB/BvB,SAAS,EAAE;IACT;IACA;IACAe,eAAe,EAAE;EAHR;AArBoB,CAAlB,CAAf"}
|
package/lib/module/TabView.js
CHANGED
|
@@ -2,9 +2,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { StyleSheet, View } from 'react-native';
|
|
5
|
-
import TabBar from './TabBar';
|
|
6
|
-
import SceneView from './SceneView';
|
|
7
5
|
import Pager from './Pager';
|
|
6
|
+
import SceneView from './SceneView';
|
|
7
|
+
import TabBar from './TabBar';
|
|
8
8
|
export default function TabView(_ref) {
|
|
9
9
|
let {
|
|
10
10
|
onIndexChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Pager","SceneView","TabBar","TabView","onIndexChange","navigationState","renderScene","initialLayout","keyboardDismissMode","lazy","lazyPreloadDistance","onSwipeStart","onSwipeEnd","renderLazyPlaceholder","renderTabBar","props","sceneContainerStyle","pagerStyle","style","swipeEnabled","tabBarPosition","animationEnabled","layout","setLayout","useState","width","height","jumpToIndex","index","handleLayout","e","nativeEvent","prevLayout","styles","pager","position","render","addEnterListener","jumpTo","sceneRendererProps","routes","map","route","i","key","loading","create","flex","overflow"],"sources":["TabView.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n LayoutChangeEvent,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport Pager from './Pager';\nimport SceneView from './SceneView';\nimport TabBar from './TabBar';\nimport type {\n Layout,\n NavigationState,\n PagerProps,\n Route,\n SceneRendererProps,\n} from './types';\n\nexport type Props<T extends Route> = PagerProps & {\n onIndexChange: (index: number) => void;\n navigationState: NavigationState<T>;\n renderScene: (props: SceneRendererProps & { route: T }) => React.ReactNode;\n renderLazyPlaceholder?: (props: { route: T }) => React.ReactNode;\n renderTabBar?: (\n props: SceneRendererProps & { navigationState: NavigationState<T> }\n ) => React.ReactNode;\n tabBarPosition?: 'top' | 'bottom';\n initialLayout?: Partial<Layout>;\n lazy?: ((props: { route: T }) => boolean) | boolean;\n lazyPreloadDistance?: number;\n sceneContainerStyle?: StyleProp<ViewStyle>;\n pagerStyle?: StyleProp<ViewStyle>;\n style?: StyleProp<ViewStyle>;\n};\n\nexport default function TabView<T extends Route>({\n onIndexChange,\n navigationState,\n renderScene,\n initialLayout,\n keyboardDismissMode = 'auto',\n lazy = false,\n lazyPreloadDistance = 0,\n onSwipeStart,\n onSwipeEnd,\n renderLazyPlaceholder = () => null,\n renderTabBar = (props) => <TabBar {...props} />,\n sceneContainerStyle,\n pagerStyle,\n style,\n swipeEnabled = true,\n tabBarPosition = 'top',\n animationEnabled = true,\n}: Props<T>) {\n const [layout, setLayout] = React.useState({\n width: 0,\n height: 0,\n ...initialLayout,\n });\n\n const jumpToIndex = (index: number) => {\n if (index !== navigationState.index) {\n onIndexChange(index);\n }\n };\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n setLayout((prevLayout) => {\n if (prevLayout.width === width && prevLayout.height === height) {\n return prevLayout;\n }\n\n return { height, width };\n });\n };\n\n return (\n <View onLayout={handleLayout} style={[styles.pager, style]}>\n <Pager\n layout={layout}\n navigationState={navigationState}\n keyboardDismissMode={keyboardDismissMode}\n swipeEnabled={swipeEnabled}\n onSwipeStart={onSwipeStart}\n onSwipeEnd={onSwipeEnd}\n onIndexChange={jumpToIndex}\n animationEnabled={animationEnabled}\n style={pagerStyle}\n >\n {({ position, render, addEnterListener, jumpTo }) => {\n // All of the props here must not change between re-renders\n // This is crucial to optimizing the routes with PureComponent\n const sceneRendererProps = {\n position,\n layout,\n jumpTo,\n };\n\n return (\n <React.Fragment>\n {tabBarPosition === 'top' &&\n renderTabBar({\n ...sceneRendererProps,\n navigationState,\n })}\n {render(\n navigationState.routes.map((route, i) => {\n return (\n <SceneView\n {...sceneRendererProps}\n addEnterListener={addEnterListener}\n key={route.key}\n index={i}\n lazy={typeof lazy === 'function' ? lazy({ route }) : lazy}\n lazyPreloadDistance={lazyPreloadDistance}\n navigationState={navigationState}\n style={sceneContainerStyle}\n >\n {({ loading }) =>\n loading\n ? renderLazyPlaceholder({ route })\n : renderScene({\n ...sceneRendererProps,\n route,\n })\n }\n </SceneView>\n );\n })\n )}\n {tabBarPosition === 'bottom' &&\n renderTabBar({\n ...sceneRendererProps,\n navigationState,\n })}\n </React.Fragment>\n );\n }}\n </Pager>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n pager: {\n flex: 1,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAGEC,UAHF,EAIEC,IAJF,QAMO,cANP;AAQA,OAAOC,KAAP,MAAkB,SAAlB;AACA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AA0BA,eAAe,SAASC,O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AY,CAAC,EACX,GAAGyB,kBADQ;MAEXlC;IAFW,CAAD,CAhChB,CADF;EAuCD,CA3DH,CADF,CADF;AAiED;AAED,MAAM4B,MAAM,GAAGnC,UAAU,CAACgD,MAAX,CAAkB;EAC/BZ,KAAK,EAAE;IACLa,IAAI,EAAE,CADD;IAELC,QAAQ,EAAE;EAFL;AADwB,CAAlB,CAAf"}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export { default as SceneMap } from './SceneMap';
|
|
1
2
|
export { default as TabBar } from './TabBar';
|
|
2
|
-
export { default as TabView } from './TabView';
|
|
3
3
|
export { default as TabBarIndicator } from './TabBarIndicator';
|
|
4
4
|
export { default as TabBarItem } from './TabBarItem';
|
|
5
|
-
export { default as
|
|
5
|
+
export { default as TabView } from './TabView';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","
|
|
1
|
+
{"version":3,"names":["default","SceneMap","TabBar","TabBarIndicator","TabBarItem","TabView"],"sources":["index.tsx"],"sourcesContent":["export { default as SceneMap } from './SceneMap';\nexport type { Props as TabBarProps } from './TabBar';\nexport { default as TabBar } from './TabBar';\nexport type { Props as TabBarIndicatorProps } from './TabBarIndicator';\nexport { default as TabBarIndicator } from './TabBarIndicator';\nexport type { Props as TabBarItemProps } from './TabBarItem';\nexport { default as TabBarItem } from './TabBarItem';\nexport type { Props as TabViewProps } from './TabView';\nexport { default as TabView } from './TabView';\nexport type { NavigationState, Route, SceneRendererProps } from './types';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,QAApB,QAAoC,YAApC;AAEA,SAASD,OAAO,IAAIE,MAApB,QAAkC,UAAlC;AAEA,SAASF,OAAO,IAAIG,eAApB,QAA2C,mBAA3C;AAEA,SAASH,OAAO,IAAII,UAApB,QAAsC,cAAtC;AAEA,SAASJ,OAAO,IAAIK,OAApB,QAAmC,WAAnC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EventEmitterProps, NavigationState, PagerProps, Route } from './types';
|
|
4
4
|
declare type Props<T extends Route> = PagerProps & {
|
|
5
5
|
onIndexChange: (index: number) => void;
|
|
6
6
|
navigationState: NavigationState<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EventEmitterProps, Layout, NavigationState, PagerProps, Route } from './types';
|
|
4
4
|
declare type Props<T extends Route> = PagerProps & {
|
|
5
5
|
layout: Layout;
|
|
6
6
|
onIndexChange: (index: number) => void;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EventEmitterProps, NavigationState, Route, SceneRendererProps } from './types';
|
|
4
4
|
declare type Props<T extends Route> = SceneRendererProps & EventEmitterProps & {
|
|
5
5
|
navigationState: NavigationState<T>;
|
|
6
6
|
lazy: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyleProp,
|
|
3
|
-
import { Props as TabBarItemProps } from './TabBarItem';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
3
|
import { Props as IndicatorProps } from './TabBarIndicator';
|
|
5
|
-
import
|
|
4
|
+
import { Props as TabBarItemProps } from './TabBarItem';
|
|
5
|
+
import type { Event, NavigationState, Route, Scene, SceneRendererProps } from './types';
|
|
6
6
|
export declare type Props<T extends Route> = SceneRendererProps & {
|
|
7
7
|
navigationState: NavigationState<T>;
|
|
8
8
|
scrollEnabled?: boolean;
|
|
@@ -37,5 +37,6 @@ export declare type Props<T extends Route> = SceneRendererProps & {
|
|
|
37
37
|
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
38
38
|
style?: StyleProp<ViewStyle>;
|
|
39
39
|
gap?: number;
|
|
40
|
+
testID?: string;
|
|
40
41
|
};
|
|
41
|
-
export default function TabBar<T extends Route>({ getLabelText, getAccessible, getAccessibilityLabel, getTestID, renderIndicator, gap, scrollEnabled, jumpTo, navigationState, position, activeColor, bounces, contentContainerStyle, inactiveColor, indicatorContainerStyle, indicatorStyle, labelStyle, onTabLongPress, onTabPress, pressColor, pressOpacity, renderBadge, renderIcon, renderLabel, renderTabBarItem, style, tabStyle, }: Props<T>): JSX.Element;
|
|
42
|
+
export default function TabBar<T extends Route>({ getLabelText, getAccessible, getAccessibilityLabel, getTestID, renderIndicator, gap, scrollEnabled, jumpTo, navigationState, position, activeColor, bounces, contentContainerStyle, inactiveColor, indicatorContainerStyle, indicatorStyle, labelStyle, onTabLongPress, onTabPress, pressColor, pressOpacity, renderBadge, renderIcon, renderLabel, renderTabBarItem, style, tabStyle, testID, }: Props<T>): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import type { Route, SceneRendererProps
|
|
3
|
+
import type { NavigationState, Route, SceneRendererProps } from './types';
|
|
4
4
|
export declare type GetTabWidth = (index: number) => number;
|
|
5
5
|
export declare type Props<T extends Route> = SceneRendererProps & {
|
|
6
6
|
navigationState: NavigationState<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Animated,
|
|
3
|
-
import type {
|
|
2
|
+
import { Animated, LayoutChangeEvent, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { NavigationState, Route, Scene } from './types';
|
|
4
4
|
export declare type Props<T extends Route> = {
|
|
5
5
|
position: Animated.AnimatedInterpolation;
|
|
6
6
|
route: T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import type { Layout, NavigationState, Route, SceneRendererProps
|
|
3
|
+
import type { Layout, NavigationState, PagerProps, Route, SceneRendererProps } from './types';
|
|
4
4
|
export declare type Props<T extends Route> = PagerProps & {
|
|
5
5
|
onIndexChange: (index: number) => void;
|
|
6
6
|
navigationState: NavigationState<T>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as SceneMap } from './SceneMap';
|
|
2
2
|
export type { Props as TabBarProps } from './TabBar';
|
|
3
|
-
export { default as
|
|
4
|
-
export type { Props as TabViewProps } from './TabView';
|
|
5
|
-
export { default as TabBarIndicator } from './TabBarIndicator';
|
|
3
|
+
export { default as TabBar } from './TabBar';
|
|
6
4
|
export type { Props as TabBarIndicatorProps } from './TabBarIndicator';
|
|
7
|
-
export { default as
|
|
5
|
+
export { default as TabBarIndicator } from './TabBarIndicator';
|
|
8
6
|
export type { Props as TabBarItemProps } from './TabBarItem';
|
|
9
|
-
export { default as
|
|
10
|
-
export type {
|
|
7
|
+
export { default as TabBarItem } from './TabBarItem';
|
|
8
|
+
export type { Props as TabViewProps } from './TabView';
|
|
9
|
+
export { default as TabView } from './TabView';
|
|
10
|
+
export type { NavigationState, Route, SceneRendererProps } from './types';
|
|
File without changes
|
|
File without changes
|