@react-navigation/bottom-tabs 6.4.0 → 6.4.1
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/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createBottomTabNavigator.js +1 -1
- package/lib/commonjs/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
- package/lib/commonjs/utils/BottomTabBarHeightContext.js.map +1 -1
- package/lib/commonjs/utils/useBottomTabBarHeight.js.map +1 -1
- package/lib/commonjs/utils/useIsKeyboardShown.js.map +1 -1
- package/lib/commonjs/views/Badge.js +1 -1
- package/lib/commonjs/views/Badge.js.map +1 -1
- package/lib/commonjs/views/BottomTabBar.js.map +1 -1
- package/lib/commonjs/views/BottomTabItem.js +1 -1
- package/lib/commonjs/views/BottomTabItem.js.map +1 -1
- package/lib/commonjs/views/BottomTabView.js +1 -1
- package/lib/commonjs/views/BottomTabView.js.map +1 -1
- package/lib/commonjs/views/ScreenFallback.js +1 -1
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/commonjs/views/TabBarIcon.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createBottomTabNavigator.js +1 -1
- package/lib/module/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
- package/lib/module/utils/BottomTabBarHeightContext.js.map +1 -1
- package/lib/module/utils/useBottomTabBarHeight.js.map +1 -1
- package/lib/module/utils/useIsKeyboardShown.js.map +1 -1
- package/lib/module/views/Badge.js +1 -1
- package/lib/module/views/Badge.js.map +1 -1
- package/lib/module/views/BottomTabBar.js.map +1 -1
- package/lib/module/views/BottomTabItem.js +1 -1
- package/lib/module/views/BottomTabItem.js.map +1 -1
- package/lib/module/views/BottomTabView.js +1 -1
- package/lib/module/views/BottomTabView.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +1 -1
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/module/views/TabBarIcon.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["/**\n * Navigators\n */\nexport { default as createBottomTabNavigator } from './navigators/createBottomTabNavigator';\n\n/**\n * Views\n */\nexport { default as BottomTabBar } from './views/BottomTabBar';\nexport { default as BottomTabView } from './views/BottomTabView';\n\n/**\n * Utilities\n */\nexport { default as BottomTabBarHeightCallbackContext } from './utils/BottomTabBarHeightCallbackContext';\nexport { default as BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';\nexport { default as useBottomTabBarHeight } from './utils/useBottomTabBarHeight';\n\n/**\n * Types\n */\nexport type {\n BottomTabBarButtonProps,\n BottomTabBarProps,\n BottomTabHeaderProps,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n BottomTabNavigationProp,\n BottomTabScreenProps,\n} from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AACA;;AACA"}
|
|
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
23
|
|
|
24
24
|
function BottomTabNavigator(_ref) {
|
|
25
25
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","warnOnce","JSON","stringify","state","descriptors","navigation","NavigationContent","useNavigationBuilder","TabRouter","createNavigatorFactory"],"sources":["createBottomTabNavigator.tsx"],"sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n ParamListBase,\n TabActionHelpers,\n TabNavigationState,\n TabRouter,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n BottomTabNavigationConfig,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n} from '../types';\nimport BottomTabView from '../views/BottomTabView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabRouterOptions &\n BottomTabNavigationConfig;\n\nfunction BottomTabNavigator({\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n sceneContainerStyle,\n ...restWithDeprecated\n}: Props) {\n const {\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: tabBarOptions is deprecated\n tabBarOptions,\n ...rest\n } = restWithDeprecated;\n\n let defaultScreenOptions: BottomTabNavigationOptions = {};\n\n if (tabBarOptions) {\n Object.assign(defaultScreenOptions, {\n tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,\n tabBarActiveTintColor: tabBarOptions.activeTintColor,\n tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,\n tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,\n tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,\n tabBarAllowFontScaling: tabBarOptions.allowFontScaling,\n tabBarShowLabel: tabBarOptions.showLabel,\n tabBarLabelStyle: tabBarOptions.labelStyle,\n tabBarIconStyle: tabBarOptions.iconStyle,\n tabBarItemStyle: tabBarOptions.tabStyle,\n tabBarLabelPosition:\n tabBarOptions.labelPosition ??\n (tabBarOptions.adaptive === false ? 'below-icon' : undefined),\n tabBarStyle: [\n { display: tabBarOptions.tabBarVisible ? 'none' : 'flex' },\n defaultScreenOptions.tabBarStyle,\n ],\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof BottomTabNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n tabBarOptions,\n `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\\n\\nPlace the following in 'screenOptions' in your code to keep current behavior:\\n\\n${JSON.stringify(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`\n );\n }\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n TabActionHelpers<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n >(TabRouter, {\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <BottomTabView\n {...rest}\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n sceneContainerStyle={sceneContainerStyle}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap,\n typeof BottomTabNavigator\n>(BottomTabNavigator);\n"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AAOA;;;;;;;;;;AAWA,SAASA,kBAAT,OASU;EAAA,IATkB;IAC1BC,EAD0B;IAE1BC,gBAF0B;IAG1BC,YAH0B;IAI1BC,QAJ0B;IAK1BC,eAL0B;IAM1BC,aAN0B;IAO1BC,mBAP0B;IAQ1B,GAAGC;EARuB,CASlB;EACR,MAAM;IACJ;IACAC,IAFI;IAGJ;IACAC,aAJI;IAKJ,GAAGC;EALC,IAMFH,kBANJ;EAQA,IAAII,oBAAgD,GAAG,EAAvD;;EAEA,IAAIF,aAAJ,EAAmB;IAAA;;IACjBG,MAAM,CAACC,MAAP,CAAcF,oBAAd,EAAoC;MAClCG,oBAAoB,EAAEL,aAAa,CAACM,mBADF;MAElCC,qBAAqB,EAAEP,aAAa,CAACQ,eAFH;MAGlCC,uBAAuB,EAAET,aAAa,CAACU,i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MXC,aANW;IAOXM;EAPW,CANb,CADF;EAiBA,oBACE,oBAAC,iBAAD,qBACE,oBAAC,sBAAD,eACMD,IADN;IAEE,KAAK,EAAEqC,KAFT;IAGE,UAAU,EAAEE,UAHd;IAIE,WAAW,EAAED,WAJf;IAKE,mBAAmB,EAAE1C;EALvB,GADF,CADF;AAWD;;eAEc,IAAA+C,8BAAA,EAKbtD,kBALa,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type { HeaderOptions } from '@react-navigation/elements';\nimport type {\n Descriptor,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n RouteProp,\n TabActionHelpers,\n TabNavigationState,\n} from '@react-navigation/native';\nimport type * as React from 'react';\nimport type {\n Animated,\n GestureResponderEvent,\n StyleProp,\n TextStyle,\n TouchableWithoutFeedbackProps,\n ViewStyle,\n} from 'react-native';\nimport type { EdgeInsets } from 'react-native-safe-area-context';\n\nexport type Layout = { width: number; height: number };\n\nexport type BottomTabNavigationEventMap = {\n /**\n * Event which fires on tapping on the tab in the tab bar.\n */\n tabPress: { data: undefined; canPreventDefault: true };\n /**\n * Event which fires on long press on the tab in the tab bar.\n */\n tabLongPress: { data: undefined };\n};\n\nexport type LabelPosition = 'beside-icon' | 'below-icon';\n\nexport type BottomTabNavigationHelpers = NavigationHelpers<\n ParamListBase,\n BottomTabNavigationEventMap\n> &\n TabActionHelpers<ParamListBase>;\n\nexport type BottomTabNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n TabNavigationState<ParamList>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabActionHelpers<ParamList>;\n\nexport type BottomTabScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = {\n navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;\n route: RouteProp<ParamList, RouteName>;\n};\n\nexport type TimingKeyboardAnimationConfig = {\n animation: 'timing';\n config?: Omit<\n Partial<Animated.TimingAnimationConfig>,\n 'toValue' | 'useNativeDriver'\n >;\n};\n\nexport type SpringKeyboardAnimationConfig = {\n animation: 'spring';\n config?: Omit<\n Partial<Animated.SpringAnimationConfig>,\n 'toValue' | 'useNativeDriver'\n >;\n};\n\nexport type TabBarVisibilityAnimationConfig =\n | TimingKeyboardAnimationConfig\n | SpringKeyboardAnimationConfig;\n\nexport type BottomTabNavigationOptions = HeaderOptions & {\n /**\n * Title text for the screen.\n */\n title?: string;\n\n /**\n * Title string of a tab displayed in the tab bar\n * or a function that given { focused: boolean, color: string, position: 'below-icon' | 'beside-icon' } returns a React.Node to display in tab bar.\n *\n * When undefined, scene title is used. Use `tabBarShowLabel` to hide the label.\n */\n tabBarLabel?:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n\n /**\n * Whether the tab label should be visible. Defaults to `true`.\n */\n tabBarShowLabel?: boolean;\n\n /**\n * Whether the label is shown below the icon or beside the icon.\n *\n * - `below-icon`: the label is shown below the icon (typical for iPhones)\n * - `beside-icon` the label is shown next to the icon (typical for iPad)\n *\n * By default, the position is chosen automatically based on device width.\n */\n tabBarLabelPosition?: LabelPosition;\n\n /**\n * Style object for the tab label.\n */\n tabBarLabelStyle?: StyleProp<TextStyle>;\n\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n tabBarAllowFontScaling?: boolean;\n\n /**\n * A function that given { focused: boolean, color: string } returns a React.Node to display in the tab bar.\n */\n tabBarIcon?: (props: {\n focused: boolean;\n color: string;\n size: number;\n }) => React.ReactNode;\n\n /**\n * Style object for the tab icon.\n */\n tabBarIconStyle?: StyleProp<TextStyle>;\n\n /**\n * Text to show in a badge on the tab icon.\n */\n tabBarBadge?: number | string;\n\n /**\n * Custom style for the tab bar badge.\n * You can specify a background color or text color here.\n */\n tabBarBadgeStyle?: StyleProp<TextStyle>;\n\n /**\n * Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.\n * It's recommended to set this if you don't have a label for the tab.\n */\n tabBarAccessibilityLabel?: string;\n\n /**\n * ID to locate this tab button in tests.\n */\n tabBarTestID?: string;\n\n /**\n * Function which returns a React element to render as the tab bar button.\n * Renders `Pressable` by default.\n */\n tabBarButton?: (props: BottomTabBarButtonProps) => React.ReactNode;\n\n /**\n * Color for the icon and label in the active tab.\n */\n tabBarActiveTintColor?: string;\n\n /**\n * Color for the icon and label in the inactive tabs.\n */\n tabBarInactiveTintColor?: string;\n\n /**\n * Background color for the active tab.\n */\n tabBarActiveBackgroundColor?: string;\n\n /**\n * Background color for the inactive tabs.\n */\n tabBarInactiveBackgroundColor?: string;\n\n /**\n * Style object for the tab item container.\n */\n tabBarItemStyle?: StyleProp<ViewStyle>;\n\n /**\n * Whether the tab bar gets hidden when the keyboard is shown. Defaults to `false`.\n */\n tabBarHideOnKeyboard?: boolean;\n\n /**\n * Animation config for showing and hiding the tab bar when the keyboard is shown/hidden.\n */\n tabBarVisibilityAnimationConfig?: {\n show?: TabBarVisibilityAnimationConfig;\n hide?: TabBarVisibilityAnimationConfig;\n };\n\n /**\n * Style object for the tab bar container.\n */\n tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n\n /**\n * Function which returns a React Element to use as background for the tab bar.\n * You could render an image, a gradient, blur view etc.\n *\n * When using `BlurView`, make sure to set `position: 'absolute'` in `tabBarStyle` as well.\n * You'd also need to use `useBottomTabBarHeight()` to add a bottom padding to your content.\n */\n tabBarBackground?: () => React.ReactNode;\n\n /**\n * Whether this screens should render the first time it's accessed. Defaults to `true`.\n * Set it to `false` if you want to render the screen on initial render.\n */\n lazy?: boolean;\n\n /**\n * Function that given returns a React Element to display as a header.\n */\n header?: (props: BottomTabHeaderProps) => React.ReactNode;\n\n /**\n * Whether to show the header. Setting this to `false` hides the header.\n * Defaults to `true`.\n */\n headerShown?: boolean;\n\n /**\n * Whether this screen should be unmounted when navigating away from it.\n * Defaults to `false`.\n */\n unmountOnBlur?: boolean;\n\n /**\n * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.\n * Defaults to `true` when `enableFreeze()` is run at the top of the application.\n * Requires `react-native-screens` version >=3.16.0.\n *\n * Only supported on iOS and Android.\n */\n freezeOnBlur?: boolean;\n};\n\nexport type BottomTabDescriptor = Descriptor<\n BottomTabNavigationOptions,\n BottomTabNavigationProp<ParamListBase>,\n RouteProp<ParamListBase>\n>;\n\nexport type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;\n\nexport type BottomTabNavigationConfig = {\n /**\n * Function that returns a React element to display as the tab bar.\n */\n tabBar?: (props: BottomTabBarProps) => React.ReactNode;\n /**\n * Safe area insets for the tab bar. This is used to avoid elements like the navigation bar on Android and bottom safe area on iOS.\n * By default, the device's safe area insets are automatically detected. You can override the behavior with this option.\n */\n safeAreaInsets?: {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n };\n /**\n * Whether inactive screens should be detached from the view hierarchy to save memory.\n * Make sure to call `enableScreens` from `react-native-screens` to make it work.\n * Defaults to `true` on Android.\n */\n detachInactiveScreens?: boolean;\n /**\n * Style object for the component wrapping the screen content.\n */\n sceneContainerStyle?: StyleProp<ViewStyle>;\n};\n\nexport type BottomTabHeaderProps = {\n /**\n * Layout of the screen.\n */\n layout: Layout;\n /**\n * Options for the current screen.\n */\n options: BottomTabNavigationOptions;\n /**\n * Route object for the current screen.\n */\n route: RouteProp<ParamListBase>;\n /**\n * Navigation prop for the header.\n */\n navigation: BottomTabNavigationProp<ParamListBase>;\n};\n\nexport type BottomTabBarProps = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>;\n insets: EdgeInsets;\n};\n\nexport type BottomTabBarButtonProps = Omit<\n TouchableWithoutFeedbackProps,\n 'onPress'\n> & {\n to?: string;\n children: React.ReactNode;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sources":["BottomTabBarHeightCallbackContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<((height: number) => void) | undefined>(\n undefined\n);\n"],"mappings":";;;;;;;AAAA;;;;;;4BAEeA,KAAK,CAACC,aAAN,CACbC,SADa,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sources":["BottomTabBarHeightContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<number | undefined>(undefined);\n"],"mappings":";;;;;;;AAAA;;;;;;4BAEeA,KAAK,CAACC,aAAN,CAAwCC,SAAxC,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useFloatingBottomTabBarHeight","height","React","useContext","BottomTabBarHeightContext","undefined","Error"],"sources":["useBottomTabBarHeight.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport BottomTabBarHeightContext from './BottomTabBarHeightContext';\n\nexport default function useFloatingBottomTabBarHeight() {\n const height = React.useContext(BottomTabBarHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?\"\n );\n }\n\n return height;\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;AAEe,SAASA,6BAAT,GAAyC;EACtD,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAN,CAAiBC,kCAAjB,CAAf;;EAEA,IAAIH,MAAM,KAAKI,SAAf,EAA0B;IACxB,MAAM,IAAIC,KAAJ,CACJ,2FADI,CAAN;EAGD;;EAED,OAAOL,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","React","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","Platform","OS","Keyboard","addListener","forEach","s","remove"],"sources":["useIsKeyboardShown.tsx"],"sourcesContent":["import * as React from 'react';\nimport { EmitterSubscription, Keyboard, Platform } from 'react-native';\n\nexport default function useIsKeyboardShown() {\n const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);\n\n React.useEffect(() => {\n const handleKeyboardShow = () => setIsKeyboardShown(true);\n const handleKeyboardHide = () => setIsKeyboardShown(false);\n\n let subscriptions: EmitterSubscription[];\n\n if (Platform.OS === 'ios') {\n subscriptions = [\n Keyboard.addListener('keyboardWillShow', handleKeyboardShow),\n Keyboard.addListener('keyboardWillHide', handleKeyboardHide),\n ];\n } else {\n subscriptions = [\n Keyboard.addListener('keyboardDidShow', handleKeyboardShow),\n Keyboard.addListener('keyboardDidHide', handleKeyboardHide),\n ];\n }\n\n return () => {\n subscriptions.forEach((s) => s.remove());\n };\n }, []);\n\n return isKeyboardShown;\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAEe,SAASA,kBAAT,GAA8B;EAC3C,MAAM,CAACC,eAAD,EAAkBC,kBAAlB,IAAwCC,KAAK,CAACC,QAAN,CAAe,KAAf,CAA9C;EAEAD,KAAK,CAACE,SAAN,CAAgB,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,IAAD,CAAnD;;IACA,MAAMK,kBAAkB,GAAG,MAAML,kBAAkB,CAAC,KAAD,CAAnD;;IAEA,IAAIM,aAAJ;;IAEA,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;MACzBF,aAAa,GAAG,CACdG,qBAAA,CAASC,WAAT,CAAqB,kBAArB,EAAyCN,kBAAzC,CADc,EAEdK,qBAAA,CAASC,WAAT,CAAqB,kBAArB,EAAyCL,kBAAzC,CAFc,CAAhB;IAID,CALD,MAKO;MACLC,aAAa,GAAG,CACdG,qBAAA,CAASC,WAAT,CAAqB,iBAArB,EAAwCN,kBAAxC,CADc,EAEdK,qBAAA,CAASC,WAAT,CAAqB,iBAArB,EAAwCL,kBAAxC,CAFc,CAAhB;IAID;;IAED,OAAO,MAAM;MACXC,aAAa,CAACK,OAAd,CAAuBC,CAAD,IAAOA,CAAC,CAACC,MAAF,EAA7B;IACD,CAFD;EAGD,CArBD,EAqBG,EArBH;EAuBA,OAAOd,eAAP;AACD"}
|
|
@@ -19,7 +19,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
23
|
|
|
24
24
|
function Badge(_ref) {
|
|
25
25
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Badge","children","style","visible","size","rest","opacity","React","useState","Animated","Value","rendered","setRendered","theme","useTheme","useEffect","timing","toValue","duration","useNativeDriver","start","finished","stopAnimation","backgroundColor","colors","notification","restStyle","StyleSheet","flatten","textColor","color","isLight","borderRadius","fontSize","Math","floor","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sources":["Badge.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport color from 'color';\nimport * as React from 'react';\nimport { Animated, StyleProp, StyleSheet, TextStyle } from 'react-native';\n\ntype Props = {\n /**\n * Whether the badge is visible\n */\n visible: boolean;\n /**\n * Content of the `Badge`.\n */\n children?: string | number;\n /**\n * Size of the `Badge`.\n */\n size?: number;\n /**\n * Style object for the tab bar container.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport default function Badge({\n children,\n style,\n visible = true,\n size = 18,\n ...rest\n}: Props) {\n const [opacity] = React.useState(() => new Animated.Value(visible ? 1 : 0));\n const [rendered, setRendered] = React.useState(visible);\n\n const theme = useTheme();\n\n React.useEffect(() => {\n if (!rendered) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue: visible ? 1 : 0,\n duration: 150,\n useNativeDriver: true,\n }).start(({ finished }) => {\n if (finished && !visible) {\n setRendered(false);\n }\n });\n\n return () => opacity.stopAnimation();\n }, [opacity, rendered, visible]);\n\n if (!rendered) {\n if (visible) {\n setRendered(true);\n } else {\n return null;\n }\n }\n\n // @ts-expect-error: backgroundColor definitely exists\n const { backgroundColor = theme.colors.notification, ...restStyle } =\n StyleSheet.flatten(style) || {};\n const textColor = color(backgroundColor).isLight() ? 'black' : 'white';\n\n const borderRadius = size / 2;\n const fontSize = Math.floor((size * 3) / 4);\n\n return (\n <Animated.Text\n numberOfLines={1}\n style={[\n {\n transform: [\n {\n scale: opacity.interpolate({\n inputRange: [0, 1],\n outputRange: [0.5, 1],\n }),\n },\n ],\n color: textColor,\n lineHeight: size - 1,\n height: size,\n minWidth: size,\n opacity,\n backgroundColor,\n fontSize,\n borderRadius,\n },\n styles.container,\n restStyle,\n ]}\n {...rest}\n >\n {children}\n </Animated.Text>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'flex-end',\n textAlign: 'center',\n paddingHorizontal: 4,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;AAqBe,SAASA,KAAT,OAML;EAAA,IANoB;IAC5BC,QAD4B;IAE5BC,KAF4B;IAG5BC,OAAO,GAAG,IAHkB;IAI5BC,IAAI,GAAG,EAJqB;IA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AG,CAA5B;EACA,MAAM6B,QAAQ,GAAGC,IAAI,CAACC,KAAL,CAAY/B,IAAI,GAAG,CAAR,GAAa,CAAxB,CAAjB;EAEA,oBACE,oBAAC,qBAAD,CAAU,IAAV;IACE,aAAa,EAAE,CADjB;IAEE,KAAK,EAAE,CACL;MACEgC,SAAS,EAAE,CACT;QACEC,KAAK,EAAE/B,OAAO,CAACgC,WAAR,CAAoB;UACzBC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADa;UAEzBC,WAAW,EAAE,CAAC,GAAD,EAAM,CAAN;QAFY,CAApB;MADT,CADS,CADb;MASEV,KAAK,EAAED,SATT;MAUEY,UAAU,EAAErC,IAAI,GAAG,CAVrB;MAWEsC,MAAM,EAAEtC,IAXV;MAYEuC,QAAQ,EAAEvC,IAZZ;MAaEE,OAbF;MAcEiB,eAdF;MAeEU,QAfF;MAgBED;IAhBF,CADK,EAmBLY,MAAM,CAACC,SAnBF,EAoBLnB,SApBK;EAFT,GAwBMrB,IAxBN,GA0BGJ,QA1BH,CADF;AA8BD;;AAED,MAAM2C,MAAM,GAAGjB,uBAAA,CAAWmB,MAAX,CAAkB;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UADF;IAETC,SAAS,EAAE,QAFF;IAGTC,iBAAiB,EAAE,CAHV;IAITC,QAAQ,EAAE;EAJD;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomTabBar.tsx"],"names":["DEFAULT_TABBAR_HEIGHT","COMPACT_TABBAR_HEIGHT","DEFAULT_MAX_TAB_ITEM_WIDTH","useNativeDriver","Platform","OS","shouldUseHorizontalLabels","state","descriptors","layout","dimensions","tabBarLabelPosition","routes","index","key","options","width","maxTabWidth","reduce","acc","route","tabBarItemStyle","flattenedStyle","StyleSheet","flatten","maxWidth","height","getPaddingBottom","insets","Math","max","bottom","select","ios","default","getTabBarHeight","style","rest","customHeight","isLandscape","horizontalLabels","paddingBottom","isPad","BottomTabBar","navigation","colors","buildLink","focusedRoute","focusedDescriptor","focusedOptions","tabBarShowLabel","tabBarHideOnKeyboard","tabBarVisibilityAnimationConfig","tabBarStyle","tabBarBackground","tabBarActiveTintColor","tabBarInactiveTintColor","tabBarActiveBackgroundColor","tabBarInactiveBackgroundColor","isKeyboardShown","onHeightChange","React","useContext","BottomTabBarHeightCallbackContext","shouldShowTabBar","visibilityAnimationConfigRef","useRef","useEffect","current","isTabBarHidden","setIsTabBarHidden","useState","visible","Animated","Value","visibilityAnimationConfig","animation","show","spring","timing","toValue","duration","config","start","finished","hide","stopAnimation","setLayout","handleLayout","e","nativeEvent","tabBarHeight","hasHorizontalLabels","tabBarBackgroundElement","styles","tabBar","backgroundColor","card","borderTopColor","border","transform","translateY","interpolate","inputRange","outputRange","hairlineWidth","position","paddingHorizontal","left","right","absoluteFill","content","map","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","CommonActions","navigate","name","merge","onLongPress","label","tabBarLabel","undefined","title","accessibilityLabel","tabBarAccessibilityLabel","length","params","tabBarTestID","tabBarAllowFontScaling","tabBarButton","tabBarIcon","color","size","tabBarBadge","tabBarBadgeStyle","tabBarLabelStyle","tabBarIconStyle","create","borderTopWidth","elevation","flex","flexDirection"],"mappings":";;;;;;;;AAAA;;AACA;;AASA;;AACA;;AASA;;AAGA;;AACA;;AACA;;;;AAMA,MAAMA,qBAAqB,GAAG,EAA9B;AACA,MAAMC,qBAAqB,GAAG,EAA9B;AACA,MAAMC,0BAA0B,GAAG,GAAnC;AAEA,MAAMC,eAAe,GAAGC,sBAASC,EAAT,KAAgB,KAAxC;;AASA,MAAMC,yBAAyB,GAAG,QAKnB;AAAA,MALoB;AACjCC,IAAAA,KADiC;AAEjCC,IAAAA,WAFiC;AAGjCC,IAAAA,MAHiC;AAIjCC,IAAAA;AAJiC,GAKpB;AACb,QAAM;AAAEC,IAAAA;AAAF,MACJH,WAAW,CAACD,KAAK,CAACK,MAAN,CAAaL,KAAK,C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N0C,IAAAA,SAAS,EAAE;AALL,GADuB;AAQ/BpC,EAAAA,OAAO,EAAE;AACPqC,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,aAAa,EAAE;AAFR;AARsB,CAAlB,CAAf","sourcesContent":["import { MissingIcon } from '@react-navigation/elements';\nimport {\n CommonActions,\n NavigationContext,\n NavigationRouteContext,\n ParamListBase,\n TabNavigationState,\n useLinkBuilder,\n useTheme,\n} from '@react-navigation/native';\nimport React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport { EdgeInsets, useSafeAreaFrame } from 'react-native-safe-area-context';\n\nimport type { BottomTabBarProps, BottomTabDescriptorMap } from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport useIsKeyboardShown from '../utils/useIsKeyboardShown';\nimport BottomTabItem from './BottomTabItem';\n\ntype Props = BottomTabBarProps & {\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n};\n\nconst DEFAULT_TABBAR_HEIGHT = 49;\nconst COMPACT_TABBAR_HEIGHT = 32;\nconst DEFAULT_MAX_TAB_ITEM_WIDTH = 125;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\ntype Options = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n layout: { height: number; width: number };\n dimensions: { height: number; width: number };\n};\n\nconst shouldUseHorizontalLabels = ({\n state,\n descriptors,\n layout,\n dimensions,\n}: Options) => {\n const { tabBarLabelPosition } =\n descriptors[state.routes[state.index].key].options;\n\n if (tabBarLabelPosition) {\n switch (tabBarLabelPosition) {\n case 'beside-icon':\n return true;\n case 'below-icon':\n return false;\n }\n }\n\n if (layout.width >= 768) {\n // Screen size matches a tablet\n const maxTabWidth = state.routes.reduce((acc, route) => {\n const { tabBarItemStyle } = descriptors[route.key].options;\n const flattenedStyle = StyleSheet.flatten(tabBarItemStyle);\n\n if (flattenedStyle) {\n if (typeof flattenedStyle.width === 'number') {\n return acc + flattenedStyle.width;\n } else if (typeof flattenedStyle.maxWidth === 'number') {\n return acc + flattenedStyle.maxWidth;\n }\n }\n\n return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;\n }, 0);\n\n return maxTabWidth <= layout.width;\n } else {\n return dimensions.width > dimensions.height;\n }\n};\n\nconst getPaddingBottom = (insets: EdgeInsets) =>\n Math.max(insets.bottom - Platform.select({ ios: 4, default: 0 }), 0);\n\nexport const getTabBarHeight = ({\n state,\n descriptors,\n dimensions,\n insets,\n style,\n ...rest\n}: Options & {\n insets: EdgeInsets;\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;\n}) => {\n // @ts-ignore\n const customHeight = StyleSheet.flatten(style)?.height;\n\n if (typeof customHeight === 'number') {\n return customHeight;\n }\n\n const isLandscape = dimensions.width > dimensions.height;\n const horizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n ...rest,\n });\n const paddingBottom = getPaddingBottom(insets);\n\n if (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n isLandscape &&\n horizontalLabels\n ) {\n return COMPACT_TABBAR_HEIGHT + paddingBottom;\n }\n\n return DEFAULT_TABBAR_HEIGHT + paddingBottom;\n};\n\nexport default function BottomTabBar({\n state,\n navigation,\n descriptors,\n insets,\n style,\n}: Props) {\n const { colors } = useTheme();\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const {\n tabBarShowLabel,\n tabBarHideOnKeyboard = false,\n tabBarVisibilityAnimationConfig,\n tabBarStyle,\n tabBarBackground,\n tabBarActiveTintColor,\n tabBarInactiveTintColor,\n tabBarActiveBackgroundColor,\n tabBarInactiveBackgroundColor,\n } = focusedOptions;\n\n const dimensions = useSafeAreaFrame();\n const isKeyboardShown = useIsKeyboardShown();\n\n const onHeightChange = React.useContext(BottomTabBarHeightCallbackContext);\n\n const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);\n\n const visibilityAnimationConfigRef = React.useRef(\n tabBarVisibilityAnimationConfig\n );\n\n React.useEffect(() => {\n visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;\n });\n\n const [isTabBarHidden, setIsTabBarHidden] = React.useState(!shouldShowTabBar);\n\n const [visible] = React.useState(\n () => new Animated.Value(shouldShowTabBar ? 1 : 0)\n );\n\n React.useEffect(() => {\n const visibilityAnimationConfig = visibilityAnimationConfigRef.current;\n\n if (shouldShowTabBar) {\n const animation =\n visibilityAnimationConfig?.show?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 1,\n useNativeDriver,\n duration: 250,\n ...visibilityAnimationConfig?.show?.config,\n }).start(({ finished }) => {\n if (finished) {\n setIsTabBarHidden(false);\n }\n });\n } else {\n setIsTabBarHidden(true);\n\n const animation =\n visibilityAnimationConfig?.hide?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 0,\n useNativeDriver,\n duration: 200,\n ...visibilityAnimationConfig?.hide?.config,\n }).start();\n }\n\n return () => visible.stopAnimation();\n }, [visible, shouldShowTabBar]);\n\n const [layout, setLayout] = React.useState({\n height: 0,\n width: dimensions.width,\n });\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n onHeightChange?.(height);\n\n setLayout((layout) => {\n if (height === layout.height && width === layout.width) {\n return layout;\n } else {\n return {\n height,\n width,\n };\n }\n });\n };\n\n const { routes } = state;\n\n const paddingBottom = getPaddingBottom(insets);\n const tabBarHeight = getTabBarHeight({\n state,\n descriptors,\n insets,\n dimensions,\n layout,\n style: [tabBarStyle, style],\n });\n\n const hasHorizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n layout,\n });\n\n const tabBarBackgroundElement = tabBarBackground?.();\n\n return (\n <Animated.View\n style={[\n styles.tabBar,\n {\n backgroundColor:\n tabBarBackgroundElement != null ? 'transparent' : colors.card,\n borderTopColor: colors.border,\n },\n {\n transform: [\n {\n translateY: visible.interpolate({\n inputRange: [0, 1],\n outputRange: [\n layout.height + paddingBottom + StyleSheet.hairlineWidth,\n 0,\n ],\n }),\n },\n ],\n // Absolutely position the tab bar so that the content is below it\n // This is needed to avoid gap at bottom when the tab bar is hidden\n position: isTabBarHidden ? 'absolute' : (null as any),\n },\n {\n height: tabBarHeight,\n paddingBottom,\n paddingHorizontal: Math.max(insets.left, insets.right),\n },\n tabBarStyle,\n ]}\n pointerEvents={isTabBarHidden ? 'none' : 'auto'}\n onLayout={handleLayout}\n >\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n {tabBarBackgroundElement}\n </View>\n <View accessibilityRole=\"tablist\" style={styles.content}>\n {routes.map((route, index) => {\n const focused = index === state.index;\n const { options } = descriptors[route.key];\n\n const onPress = () => {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (!focused && !event.defaultPrevented) {\n navigation.dispatch({\n ...CommonActions.navigate({ name: route.name, merge: true }),\n target: state.key,\n });\n }\n };\n\n const onLongPress = () => {\n navigation.emit({\n type: 'tabLongPress',\n target: route.key,\n });\n };\n\n const label =\n options.tabBarLabel !== undefined\n ? options.tabBarLabel\n : options.title !== undefined\n ? options.title\n : route.name;\n\n const accessibilityLabel =\n options.tabBarAccessibilityLabel !== undefined\n ? options.tabBarAccessibilityLabel\n : typeof label === 'string' && Platform.OS === 'ios'\n ? `${label}, tab, ${index + 1} of ${routes.length}`\n : undefined;\n\n return (\n <NavigationContext.Provider\n key={route.key}\n value={descriptors[route.key].navigation}\n >\n <NavigationRouteContext.Provider value={route}>\n <BottomTabItem\n route={route}\n focused={focused}\n horizontal={hasHorizontalLabels}\n onPress={onPress}\n onLongPress={onLongPress}\n accessibilityLabel={accessibilityLabel}\n to={buildLink(route.name, route.params)}\n testID={options.tabBarTestID}\n allowFontScaling={options.tabBarAllowFontScaling}\n activeTintColor={tabBarActiveTintColor}\n inactiveTintColor={tabBarInactiveTintColor}\n activeBackgroundColor={tabBarActiveBackgroundColor}\n inactiveBackgroundColor={tabBarInactiveBackgroundColor}\n button={options.tabBarButton}\n icon={\n options.tabBarIcon ??\n (({ color, size }) => (\n <MissingIcon color={color} size={size} />\n ))\n }\n badge={options.tabBarBadge}\n badgeStyle={options.tabBarBadgeStyle}\n label={label}\n showLabel={tabBarShowLabel}\n labelStyle={options.tabBarLabelStyle}\n iconStyle={options.tabBarIconStyle}\n style={options.tabBarItemStyle}\n />\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n );\n })}\n </View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n tabBar: {\n left: 0,\n right: 0,\n bottom: 0,\n borderTopWidth: StyleSheet.hairlineWidth,\n elevation: 8,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["DEFAULT_TABBAR_HEIGHT","COMPACT_TABBAR_HEIGHT","DEFAULT_MAX_TAB_ITEM_WIDTH","useNativeDriver","Platform","OS","shouldUseHorizontalLabels","state","descriptors","layout","dimensions","tabBarLabelPosition","routes","index","key","options","width","maxTabWidth","reduce","acc","route","tabBarItemStyle","flattenedStyle","StyleSheet","flatten","maxWidth","height","getPaddingBottom","insets","Math","max","bottom","select","ios","default","getTabBarHeight","style","rest","customHeight","isLandscape","horizontalLabels","paddingBottom","isPad","BottomTabBar","navigation","colors","useTheme","buildLink","useLinkBuilder","focusedRoute","focusedDescriptor","focusedOptions","tabBarShowLabel","tabBarHideOnKeyboard","tabBarVisibilityAnimationConfig","tabBarStyle","tabBarBackground","tabBarActiveTintColor","tabBarInactiveTintColor","tabBarActiveBackgroundColor","tabBarInactiveBackgroundColor","useSafeAreaFrame","isKeyboardShown","useIsKeyboardShown","onHeightChange","React","useContext","BottomTabBarHeightCallbackContext","shouldShowTabBar","visibilityAnimationConfigRef","useRef","useEffect","current","isTabBarHidden","setIsTabBarHidden","useState","visible","Animated","Value","visibilityAnimationConfig","animation","show","spring","timing","toValue","duration","config","start","finished","hide","stopAnimation","setLayout","handleLayout","e","nativeEvent","tabBarHeight","hasHorizontalLabels","tabBarBackgroundElement","styles","tabBar","backgroundColor","card","borderTopColor","border","transform","translateY","interpolate","inputRange","outputRange","hairlineWidth","position","paddingHorizontal","left","right","absoluteFill","content","map","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","CommonActions","navigate","name","merge","onLongPress","label","tabBarLabel","undefined","title","accessibilityLabel","tabBarAccessibilityLabel","length","params","tabBarTestID","tabBarAllowFontScaling","tabBarButton","tabBarIcon","color","size","tabBarBadge","tabBarBadgeStyle","tabBarLabelStyle","tabBarIconStyle","create","borderTopWidth","elevation","flex","flexDirection"],"sources":["BottomTabBar.tsx"],"sourcesContent":["import { MissingIcon } from '@react-navigation/elements';\nimport {\n CommonActions,\n NavigationContext,\n NavigationRouteContext,\n ParamListBase,\n TabNavigationState,\n useLinkBuilder,\n useTheme,\n} from '@react-navigation/native';\nimport React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport { EdgeInsets, useSafeAreaFrame } from 'react-native-safe-area-context';\n\nimport type { BottomTabBarProps, BottomTabDescriptorMap } from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport useIsKeyboardShown from '../utils/useIsKeyboardShown';\nimport BottomTabItem from './BottomTabItem';\n\ntype Props = BottomTabBarProps & {\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n};\n\nconst DEFAULT_TABBAR_HEIGHT = 49;\nconst COMPACT_TABBAR_HEIGHT = 32;\nconst DEFAULT_MAX_TAB_ITEM_WIDTH = 125;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\ntype Options = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n layout: { height: number; width: number };\n dimensions: { height: number; width: number };\n};\n\nconst shouldUseHorizontalLabels = ({\n state,\n descriptors,\n layout,\n dimensions,\n}: Options) => {\n const { tabBarLabelPosition } =\n descriptors[state.routes[state.index].key].options;\n\n if (tabBarLabelPosition) {\n switch (tabBarLabelPosition) {\n case 'beside-icon':\n return true;\n case 'below-icon':\n return false;\n }\n }\n\n if (layout.width >= 768) {\n // Screen size matches a tablet\n const maxTabWidth = state.routes.reduce((acc, route) => {\n const { tabBarItemStyle } = descriptors[route.key].options;\n const flattenedStyle = StyleSheet.flatten(tabBarItemStyle);\n\n if (flattenedStyle) {\n if (typeof flattenedStyle.width === 'number') {\n return acc + flattenedStyle.width;\n } else if (typeof flattenedStyle.maxWidth === 'number') {\n return acc + flattenedStyle.maxWidth;\n }\n }\n\n return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;\n }, 0);\n\n return maxTabWidth <= layout.width;\n } else {\n return dimensions.width > dimensions.height;\n }\n};\n\nconst getPaddingBottom = (insets: EdgeInsets) =>\n Math.max(insets.bottom - Platform.select({ ios: 4, default: 0 }), 0);\n\nexport const getTabBarHeight = ({\n state,\n descriptors,\n dimensions,\n insets,\n style,\n ...rest\n}: Options & {\n insets: EdgeInsets;\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;\n}) => {\n // @ts-ignore\n const customHeight = StyleSheet.flatten(style)?.height;\n\n if (typeof customHeight === 'number') {\n return customHeight;\n }\n\n const isLandscape = dimensions.width > dimensions.height;\n const horizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n ...rest,\n });\n const paddingBottom = getPaddingBottom(insets);\n\n if (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n isLandscape &&\n horizontalLabels\n ) {\n return COMPACT_TABBAR_HEIGHT + paddingBottom;\n }\n\n return DEFAULT_TABBAR_HEIGHT + paddingBottom;\n};\n\nexport default function BottomTabBar({\n state,\n navigation,\n descriptors,\n insets,\n style,\n}: Props) {\n const { colors } = useTheme();\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const {\n tabBarShowLabel,\n tabBarHideOnKeyboard = false,\n tabBarVisibilityAnimationConfig,\n tabBarStyle,\n tabBarBackground,\n tabBarActiveTintColor,\n tabBarInactiveTintColor,\n tabBarActiveBackgroundColor,\n tabBarInactiveBackgroundColor,\n } = focusedOptions;\n\n const dimensions = useSafeAreaFrame();\n const isKeyboardShown = useIsKeyboardShown();\n\n const onHeightChange = React.useContext(BottomTabBarHeightCallbackContext);\n\n const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);\n\n const visibilityAnimationConfigRef = React.useRef(\n tabBarVisibilityAnimationConfig\n );\n\n React.useEffect(() => {\n visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;\n });\n\n const [isTabBarHidden, setIsTabBarHidden] = React.useState(!shouldShowTabBar);\n\n const [visible] = React.useState(\n () => new Animated.Value(shouldShowTabBar ? 1 : 0)\n );\n\n React.useEffect(() => {\n const visibilityAnimationConfig = visibilityAnimationConfigRef.current;\n\n if (shouldShowTabBar) {\n const animation =\n visibilityAnimationConfig?.show?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 1,\n useNativeDriver,\n duration: 250,\n ...visibilityAnimationConfig?.show?.config,\n }).start(({ finished }) => {\n if (finished) {\n setIsTabBarHidden(false);\n }\n });\n } else {\n setIsTabBarHidden(true);\n\n const animation =\n visibilityAnimationConfig?.hide?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 0,\n useNativeDriver,\n duration: 200,\n ...visibilityAnimationConfig?.hide?.config,\n }).start();\n }\n\n return () => visible.stopAnimation();\n }, [visible, shouldShowTabBar]);\n\n const [layout, setLayout] = React.useState({\n height: 0,\n width: dimensions.width,\n });\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n onHeightChange?.(height);\n\n setLayout((layout) => {\n if (height === layout.height && width === layout.width) {\n return layout;\n } else {\n return {\n height,\n width,\n };\n }\n });\n };\n\n const { routes } = state;\n\n const paddingBottom = getPaddingBottom(insets);\n const tabBarHeight = getTabBarHeight({\n state,\n descriptors,\n insets,\n dimensions,\n layout,\n style: [tabBarStyle, style],\n });\n\n const hasHorizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n layout,\n });\n\n const tabBarBackgroundElement = tabBarBackground?.();\n\n return (\n <Animated.View\n style={[\n styles.tabBar,\n {\n backgroundColor:\n tabBarBackgroundElement != null ? 'transparent' : colors.card,\n borderTopColor: colors.border,\n },\n {\n transform: [\n {\n translateY: visible.interpolate({\n inputRange: [0, 1],\n outputRange: [\n layout.height + paddingBottom + StyleSheet.hairlineWidth,\n 0,\n ],\n }),\n },\n ],\n // Absolutely position the tab bar so that the content is below it\n // This is needed to avoid gap at bottom when the tab bar is hidden\n position: isTabBarHidden ? 'absolute' : (null as any),\n },\n {\n height: tabBarHeight,\n paddingBottom,\n paddingHorizontal: Math.max(insets.left, insets.right),\n },\n tabBarStyle,\n ]}\n pointerEvents={isTabBarHidden ? 'none' : 'auto'}\n onLayout={handleLayout}\n >\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n {tabBarBackgroundElement}\n </View>\n <View accessibilityRole=\"tablist\" style={styles.content}>\n {routes.map((route, index) => {\n const focused = index === state.index;\n const { options } = descriptors[route.key];\n\n const onPress = () => {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (!focused && !event.defaultPrevented) {\n navigation.dispatch({\n ...CommonActions.navigate({ name: route.name, merge: true }),\n target: state.key,\n });\n }\n };\n\n const onLongPress = () => {\n navigation.emit({\n type: 'tabLongPress',\n target: route.key,\n });\n };\n\n const label =\n options.tabBarLabel !== undefined\n ? options.tabBarLabel\n : options.title !== undefined\n ? options.title\n : route.name;\n\n const accessibilityLabel =\n options.tabBarAccessibilityLabel !== undefined\n ? options.tabBarAccessibilityLabel\n : typeof label === 'string' && Platform.OS === 'ios'\n ? `${label}, tab, ${index + 1} of ${routes.length}`\n : undefined;\n\n return (\n <NavigationContext.Provider\n key={route.key}\n value={descriptors[route.key].navigation}\n >\n <NavigationRouteContext.Provider value={route}>\n <BottomTabItem\n route={route}\n focused={focused}\n horizontal={hasHorizontalLabels}\n onPress={onPress}\n onLongPress={onLongPress}\n accessibilityLabel={accessibilityLabel}\n to={buildLink(route.name, route.params)}\n testID={options.tabBarTestID}\n allowFontScaling={options.tabBarAllowFontScaling}\n activeTintColor={tabBarActiveTintColor}\n inactiveTintColor={tabBarInactiveTintColor}\n activeBackgroundColor={tabBarActiveBackgroundColor}\n inactiveBackgroundColor={tabBarInactiveBackgroundColor}\n button={options.tabBarButton}\n icon={\n options.tabBarIcon ??\n (({ color, size }) => (\n <MissingIcon color={color} size={size} />\n ))\n }\n badge={options.tabBarBadge}\n badgeStyle={options.tabBarBadgeStyle}\n label={label}\n showLabel={tabBarShowLabel}\n labelStyle={options.tabBarLabelStyle}\n iconStyle={options.tabBarIconStyle}\n style={options.tabBarItemStyle}\n />\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n );\n })}\n </View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n tabBar: {\n left: 0,\n right: 0,\n bottom: 0,\n borderTopWidth: StyleSheet.hairlineWidth,\n elevation: 8,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n },\n});\n"],"mappings":";;;;;;;;AAAA;;AACA;;AASA;;AACA;;AASA;;AAGA;;AACA;;AACA;;;;AAMA,MAAMA,qBAAqB,GAAG,EAA9B;AACA,MAAMC,qBAAqB,GAAG,EAA9B;AACA,MAAMC,0BAA0B,GAAG,GAAnC;AAEA,MAAMC,eAAe,GAAGC,qBAAA,CAASC,EAAT,KAAgB,KAAxC;;AASA,MAAMC,yBAAyB,GAAG,QAK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C,6BAb3B;MAcE,MAAM,EAAE7C,OAAO,CAAC8H,YAdlB;MAeE,IAAI,yBACF9H,OAAO,CAAC+H,UADN,qEAED;QAAA,IAAC;UAAEC,KAAF;UAASC;QAAT,CAAD;QAAA,oBACC,6BAAC,qBAAD;UAAa,KAAK,EAAED,KAApB;UAA2B,IAAI,EAAEC;QAAjC,EADD;MAAA,CAjBL;MAqBE,KAAK,EAAEjI,OAAO,CAACkI,WArBjB;MAsBE,UAAU,EAAElI,OAAO,CAACmI,gBAtBtB;MAuBE,KAAK,EAAEf,KAvBT;MAwBE,SAAS,EAAE/E,eAxBb;MAyBE,UAAU,EAAErC,OAAO,CAACoI,gBAzBtB;MA0BE,SAAS,EAAEpI,OAAO,CAACqI,eA1BrB;MA2BE,KAAK,EAAErI,OAAO,CAACM;IA3BjB,EADF,CAJF,CADF;EAsCD,CA9EA,CADH,CArCF,CADF;AAyHD;;AAED,MAAM6E,MAAM,GAAG3E,uBAAA,CAAW8H,MAAX,CAAkB;EAC/BlD,MAAM,EAAE;IACNa,IAAI,EAAE,CADA;IAENC,KAAK,EAAE,CAFD;IAGNlF,MAAM,EAAE,CAHF;IAINuH,cAAc,EAAE/H,uBAAA,CAAWsF,aAJrB;IAKN0C,SAAS,EAAE;EALL,CADuB;EAQ/BpC,OAAO,EAAE;IACPqC,IAAI,EAAE,CADC;IAEPC,aAAa,EAAE;EAFR;AARsB,CAAlB,CAAf"}
|
|
@@ -17,7 +17,7 @@ var _TabBarIcon = _interopRequireDefault(require("./TabBarIcon"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
function _extends() { _extends = Object.assign
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
21
|
|
|
22
22
|
function BottomTabBarItem(_ref) {
|
|
23
23
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomTabItem.tsx"],"names":["BottomTabBarItem","focused","route","label","icon","badge","badgeStyle","to","button","children","style","onPress","accessibilityRole","rest","Platform","OS","styles","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","accessibilityLabel","testID","onLongPress","horizontal","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","labelStyle","iconStyle","colors","undefined","primary","text","mix","card","hex","renderLabel","color","labelBeside","labelBeneath","position","renderIcon","activeOpacity","inactiveOpacity","scene","backgroundColor","select","ios","default","accessibilityState","selected","accessibilityStates","tab","tabLandscape","tabPortrait","StyleSheet","create","flex","alignItems","justifyContent","flexDirection","textAlign","fontSize","marginLeft","marginTop","display"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAYA;;;;;;AA0Ge,SAASA,gBAAT,OAgEL;AAAA,MAhE+B;AACvCC,IAAAA,OADuC;AAEvCC,IAAAA,KAFuC;AAGvCC,IAAAA,KAHuC;AAIvCC,IAAAA,IAJuC;AAKvCC,IAAAA,KALuC;AAMvCC,IAAAA,UANuC;AAOvCC,IAAAA,EAPuC;AAQvCC,IAAAA,MAAM,GAAG,SAOsB;AAAA,UAPrB;AACRC,QAAAA,QADQ;AAERC,QAAAA,KAFQ;AAGRC,QAAAA,OAHQ;AAIRJ,QAAAA,EAJQ;AAKRK,QAAAA,iBALQ;AAMR,WAAGC;AANK,OAOqB;;AAC7B,UAAIC,sBAASC,EAAT,KAAgB,KAAhB,IAAyBR,EAA7B,EAAiC;AAC/B;AACA;AACA,4BACE,6BAAC,YAAD,eACMM,IADN;AAEE,UAAA,EAAE,EAAEN,EAFN;AAGE,UAAA,KAAK,EAAE,CAACS,MAAM,CAACR,MAAR,EAAgBE,KAAhB,CAHT;AAIE,UAAA,OAAO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J,EAAAA,WAAW,EAAE;AACXK,IAAAA,cAAc,EAAE,UADL;AAEXC,IAAAA,aAAa,EAAE;AAFJ,GALkB;AAS/BP,EAAAA,YAAY,EAAE;AACZM,IAAAA,cAAc,EAAE,QADJ;AAEZC,IAAAA,aAAa,EAAE;AAFH,GATiB;AAa/BjE,EAAAA,KAAK,EAAE;AACLkE,IAAAA,SAAS,EAAE,QADN;AAELhB,IAAAA,eAAe,EAAE;AAFZ,GAbwB;AAiB/BN,EAAAA,YAAY,EAAE;AACZuB,IAAAA,QAAQ,EAAE;AADE,GAjBiB;AAoB/BxB,EAAAA,WAAW,EAAE;AACXwB,IAAAA,QAAQ,EAAE,EADC;AAEXC,IAAAA,UAAU,EAAE,EAFD;AAGXC,IAAAA,SAAS,EAAE;AAHA,GApBkB;AAyB/BhE,EAAAA,MAAM,EAAE;AACNiE,IAAAA,OAAO,EAAE;AADH;AAzBuB,CAAlB,CAAf","sourcesContent":["import { Link, Route, useTheme } from '@react-navigation/native';\nimport Color from 'color';\nimport React from 'react';\nimport {\n GestureResponderEvent,\n Platform,\n Pressable,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nimport type { BottomTabBarButtonProps, LabelPosition } from '../types';\nimport TabBarIcon from './TabBarIcon';\n\ntype Props = {\n /**\n * Whether the tab is focused.\n */\n focused: boolean;\n /**\n * The route object which should be specified by the tab.\n */\n route: Route<string>;\n /**\n * The label text of the tab.\n */\n label:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n /**\n * Icon to display for the tab.\n */\n icon: (props: {\n focused: boolean;\n size: number;\n color: string;\n }) => React.ReactNode;\n /**\n * Text to show in a badge on the tab icon.\n */\n badge?: number | string;\n /**\n * Custom style for the badge.\n */\n badgeStyle?: StyleProp<TextStyle>;\n /**\n * URL to use for the link to the tab.\n */\n to?: string;\n /**\n * The button for the tab. Uses a `TouchableWithoutFeedback` by default.\n */\n button?: (props: BottomTabBarButtonProps) => React.ReactNode;\n /**\n * The accessibility label for the tab.\n */\n accessibilityLabel?: string;\n /**\n * An unique ID for testing for the tab.\n */\n testID?: string;\n /**\n * Function to execute on press in React Native.\n * On the web, this will use onClick.\n */\n onPress: (\n e: React.MouseEvent<HTMLElement, MouseEvent> | GestureResponderEvent\n ) => void;\n /**\n * Function to execute on long press.\n */\n onLongPress: (e: GestureResponderEvent) => void;\n /**\n * Whether the label should be aligned with the icon horizontally.\n */\n horizontal: boolean;\n /**\n * Color for the icon and label when the item is active.\n */\n activeTintColor?: string;\n /**\n * Color for the icon and label when the item is inactive.\n */\n inactiveTintColor?: string;\n /**\n * Background color for item when its active.\n */\n activeBackgroundColor?: string;\n /**\n * Background color for item when its inactive.\n */\n inactiveBackgroundColor?: string;\n /**\n * Whether to show the label text for the tab.\n */\n showLabel?: boolean;\n /**\n * Whether to allow scaling the font for the label for accessibility purposes.\n */\n allowFontScaling?: boolean;\n /**\n * Style object for the label element.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * Style object for the icon element.\n */\n iconStyle?: StyleProp<ViewStyle>;\n /**\n * Style object for the wrapper element.\n */\n style?: StyleProp<ViewStyle>;\n};\n\nexport default function BottomTabBarItem({\n focused,\n route,\n label,\n icon,\n badge,\n badgeStyle,\n to,\n button = ({\n children,\n style,\n onPress,\n to,\n accessibilityRole,\n ...rest\n }: BottomTabBarButtonProps) => {\n if (Platform.OS === 'web' && to) {\n // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.\n // We need to use `onClick` to be able to prevent default browser handling of links.\n return (\n <Link\n {...rest}\n to={to}\n style={[styles.button, style]}\n onPress={(e: any) => {\n if (\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n (e.button == null || e.button === 0) // ignore everything but left clicks\n ) {\n e.preventDefault();\n onPress?.(e);\n }\n }}\n >\n {children}\n </Link>\n );\n } else {\n return (\n <Pressable\n {...rest}\n accessibilityRole={accessibilityRole}\n onPress={onPress}\n style={style}\n >\n {children}\n </Pressable>\n );\n }\n },\n accessibilityLabel,\n testID,\n onPress,\n onLongPress,\n horizontal,\n activeTintColor: customActiveTintColor,\n inactiveTintColor: customInactiveTintColor,\n activeBackgroundColor = 'transparent',\n inactiveBackgroundColor = 'transparent',\n showLabel = true,\n allowFontScaling,\n labelStyle,\n iconStyle,\n style,\n}: Props) {\n const { colors } = useTheme();\n\n const activeTintColor =\n customActiveTintColor === undefined\n ? colors.primary\n : customActiveTintColor;\n\n const inactiveTintColor =\n customInactiveTintColor === undefined\n ? Color(colors.text).mix(Color(colors.card), 0.5).hex()\n : customInactiveTintColor;\n\n const renderLabel = ({ focused }: { focused: boolean }) => {\n if (showLabel === false) {\n return null;\n }\n\n const color = focused ? activeTintColor : inactiveTintColor;\n\n if (typeof label === 'string') {\n return (\n <Text\n numberOfLines={1}\n style={[\n styles.label,\n { color },\n horizontal ? styles.labelBeside : styles.labelBeneath,\n labelStyle,\n ]}\n allowFontScaling={allowFontScaling}\n >\n {label}\n </Text>\n );\n }\n\n return label({\n focused,\n color,\n position: horizontal ? 'beside-icon' : 'below-icon',\n });\n };\n\n const renderIcon = ({ focused }: { focused: boolean }) => {\n if (icon === undefined) {\n return null;\n }\n\n const activeOpacity = focused ? 1 : 0;\n const inactiveOpacity = focused ? 0 : 1;\n\n return (\n <TabBarIcon\n route={route}\n horizontal={horizontal}\n badge={badge}\n badgeStyle={badgeStyle}\n activeOpacity={activeOpacity}\n inactiveOpacity={inactiveOpacity}\n activeTintColor={activeTintColor}\n inactiveTintColor={inactiveTintColor}\n renderIcon={icon}\n style={iconStyle}\n />\n );\n };\n\n const scene = { route, focused };\n\n const backgroundColor = focused\n ? activeBackgroundColor\n : inactiveBackgroundColor;\n\n return button({\n to,\n onPress,\n onLongPress,\n testID,\n accessibilityLabel,\n // FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS\n accessibilityRole: Platform.select({ ios: 'button', default: 'tab' }),\n accessibilityState: { selected: focused },\n // @ts-expect-error: keep for compatibility with older React Native versions\n accessibilityStates: focused ? ['selected'] : [],\n style: [\n styles.tab,\n { backgroundColor },\n horizontal ? styles.tabLandscape : styles.tabPortrait,\n style,\n ],\n children: (\n <React.Fragment>\n {renderIcon(scene)}\n {renderLabel(scene)}\n </React.Fragment>\n ),\n }) as React.ReactElement;\n}\n\nconst styles = StyleSheet.create({\n tab: {\n flex: 1,\n alignItems: 'center',\n },\n tabPortrait: {\n justifyContent: 'flex-end',\n flexDirection: 'column',\n },\n tabLandscape: {\n justifyContent: 'center',\n flexDirection: 'row',\n },\n label: {\n textAlign: 'center',\n backgroundColor: 'transparent',\n },\n labelBeneath: {\n fontSize: 10,\n },\n labelBeside: {\n fontSize: 13,\n marginLeft: 20,\n marginTop: 3,\n },\n button: {\n display: 'flex',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["BottomTabBarItem","focused","route","label","icon","badge","badgeStyle","to","button","children","style","onPress","accessibilityRole","rest","Platform","OS","styles","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","accessibilityLabel","testID","onLongPress","horizontal","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","labelStyle","iconStyle","colors","useTheme","undefined","primary","Color","text","mix","card","hex","renderLabel","color","labelBeside","labelBeneath","position","renderIcon","activeOpacity","inactiveOpacity","scene","backgroundColor","select","ios","default","accessibilityState","selected","accessibilityStates","tab","tabLandscape","tabPortrait","StyleSheet","create","flex","alignItems","justifyContent","flexDirection","textAlign","fontSize","marginLeft","marginTop","display"],"sources":["BottomTabItem.tsx"],"sourcesContent":["import { Link, Route, useTheme } from '@react-navigation/native';\nimport Color from 'color';\nimport React from 'react';\nimport {\n GestureResponderEvent,\n Platform,\n Pressable,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nimport type { BottomTabBarButtonProps, LabelPosition } from '../types';\nimport TabBarIcon from './TabBarIcon';\n\ntype Props = {\n /**\n * Whether the tab is focused.\n */\n focused: boolean;\n /**\n * The route object which should be specified by the tab.\n */\n route: Route<string>;\n /**\n * The label text of the tab.\n */\n label:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n /**\n * Icon to display for the tab.\n */\n icon: (props: {\n focused: boolean;\n size: number;\n color: string;\n }) => React.ReactNode;\n /**\n * Text to show in a badge on the tab icon.\n */\n badge?: number | string;\n /**\n * Custom style for the badge.\n */\n badgeStyle?: StyleProp<TextStyle>;\n /**\n * URL to use for the link to the tab.\n */\n to?: string;\n /**\n * The button for the tab. Uses a `TouchableWithoutFeedback` by default.\n */\n button?: (props: BottomTabBarButtonProps) => React.ReactNode;\n /**\n * The accessibility label for the tab.\n */\n accessibilityLabel?: string;\n /**\n * An unique ID for testing for the tab.\n */\n testID?: string;\n /**\n * Function to execute on press in React Native.\n * On the web, this will use onClick.\n */\n onPress: (\n e: React.MouseEvent<HTMLElement, MouseEvent> | GestureResponderEvent\n ) => void;\n /**\n * Function to execute on long press.\n */\n onLongPress: (e: GestureResponderEvent) => void;\n /**\n * Whether the label should be aligned with the icon horizontally.\n */\n horizontal: boolean;\n /**\n * Color for the icon and label when the item is active.\n */\n activeTintColor?: string;\n /**\n * Color for the icon and label when the item is inactive.\n */\n inactiveTintColor?: string;\n /**\n * Background color for item when its active.\n */\n activeBackgroundColor?: string;\n /**\n * Background color for item when its inactive.\n */\n inactiveBackgroundColor?: string;\n /**\n * Whether to show the label text for the tab.\n */\n showLabel?: boolean;\n /**\n * Whether to allow scaling the font for the label for accessibility purposes.\n */\n allowFontScaling?: boolean;\n /**\n * Style object for the label element.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * Style object for the icon element.\n */\n iconStyle?: StyleProp<ViewStyle>;\n /**\n * Style object for the wrapper element.\n */\n style?: StyleProp<ViewStyle>;\n};\n\nexport default function BottomTabBarItem({\n focused,\n route,\n label,\n icon,\n badge,\n badgeStyle,\n to,\n button = ({\n children,\n style,\n onPress,\n to,\n accessibilityRole,\n ...rest\n }: BottomTabBarButtonProps) => {\n if (Platform.OS === 'web' && to) {\n // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.\n // We need to use `onClick` to be able to prevent default browser handling of links.\n return (\n <Link\n {...rest}\n to={to}\n style={[styles.button, style]}\n onPress={(e: any) => {\n if (\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n (e.button == null || e.button === 0) // ignore everything but left clicks\n ) {\n e.preventDefault();\n onPress?.(e);\n }\n }}\n >\n {children}\n </Link>\n );\n } else {\n return (\n <Pressable\n {...rest}\n accessibilityRole={accessibilityRole}\n onPress={onPress}\n style={style}\n >\n {children}\n </Pressable>\n );\n }\n },\n accessibilityLabel,\n testID,\n onPress,\n onLongPress,\n horizontal,\n activeTintColor: customActiveTintColor,\n inactiveTintColor: customInactiveTintColor,\n activeBackgroundColor = 'transparent',\n inactiveBackgroundColor = 'transparent',\n showLabel = true,\n allowFontScaling,\n labelStyle,\n iconStyle,\n style,\n}: Props) {\n const { colors } = useTheme();\n\n const activeTintColor =\n customActiveTintColor === undefined\n ? colors.primary\n : customActiveTintColor;\n\n const inactiveTintColor =\n customInactiveTintColor === undefined\n ? Color(colors.text).mix(Color(colors.card), 0.5).hex()\n : customInactiveTintColor;\n\n const renderLabel = ({ focused }: { focused: boolean }) => {\n if (showLabel === false) {\n return null;\n }\n\n const color = focused ? activeTintColor : inactiveTintColor;\n\n if (typeof label === 'string') {\n return (\n <Text\n numberOfLines={1}\n style={[\n styles.label,\n { color },\n horizontal ? styles.labelBeside : styles.labelBeneath,\n labelStyle,\n ]}\n allowFontScaling={allowFontScaling}\n >\n {label}\n </Text>\n );\n }\n\n return label({\n focused,\n color,\n position: horizontal ? 'beside-icon' : 'below-icon',\n });\n };\n\n const renderIcon = ({ focused }: { focused: boolean }) => {\n if (icon === undefined) {\n return null;\n }\n\n const activeOpacity = focused ? 1 : 0;\n const inactiveOpacity = focused ? 0 : 1;\n\n return (\n <TabBarIcon\n route={route}\n horizontal={horizontal}\n badge={badge}\n badgeStyle={badgeStyle}\n activeOpacity={activeOpacity}\n inactiveOpacity={inactiveOpacity}\n activeTintColor={activeTintColor}\n inactiveTintColor={inactiveTintColor}\n renderIcon={icon}\n style={iconStyle}\n />\n );\n };\n\n const scene = { route, focused };\n\n const backgroundColor = focused\n ? activeBackgroundColor\n : inactiveBackgroundColor;\n\n return button({\n to,\n onPress,\n onLongPress,\n testID,\n accessibilityLabel,\n // FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS\n accessibilityRole: Platform.select({ ios: 'button', default: 'tab' }),\n accessibilityState: { selected: focused },\n // @ts-expect-error: keep for compatibility with older React Native versions\n accessibilityStates: focused ? ['selected'] : [],\n style: [\n styles.tab,\n { backgroundColor },\n horizontal ? styles.tabLandscape : styles.tabPortrait,\n style,\n ],\n children: (\n <React.Fragment>\n {renderIcon(scene)}\n {renderLabel(scene)}\n </React.Fragment>\n ),\n }) as React.ReactElement;\n}\n\nconst styles = StyleSheet.create({\n tab: {\n flex: 1,\n alignItems: 'center',\n },\n tabPortrait: {\n justifyContent: 'flex-end',\n flexDirection: 'column',\n },\n tabLandscape: {\n justifyContent: 'center',\n flexDirection: 'row',\n },\n label: {\n textAlign: 'center',\n backgroundColor: 'transparent',\n },\n labelBeneath: {\n fontSize: 10,\n },\n labelBeside: {\n fontSize: 13,\n marginLeft: 20,\n marginTop: 3,\n },\n button: {\n display: 'flex',\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAYA;;;;;;AA0Ge,SAASA,gBAAT,OAgEL;EAAA,IAhE+B;IACvCC,OADuC;IAEvCC,KAFuC;IAGvCC,KAHuC;IAIvCC,IAJuC;IAKvCC,KALuC;IAMvCC,UANuC;IAOvCC,EAPuC;IAQvCC,MAAM,GAAG,SAOsB;MAAA,IAPrB;QACRC,QADQ;QAERC,KAF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ALkB;EAS/BP,YAAY,EAAE;IACZM,cAAc,EAAE,QADJ;IAEZC,aAAa,EAAE;EAFH,CATiB;EAa/BnE,KAAK,EAAE;IACLoE,SAAS,EAAE,QADN;IAELhB,eAAe,EAAE;EAFZ,CAbwB;EAiB/BN,YAAY,EAAE;IACZuB,QAAQ,EAAE;EADE,CAjBiB;EAoB/BxB,WAAW,EAAE;IACXwB,QAAQ,EAAE,EADC;IAEXC,UAAU,EAAE,EAFD;IAGXC,SAAS,EAAE;EAHA,CApBkB;EAyB/BlE,MAAM,EAAE;IACNmE,OAAO,EAAE;EADH;AAzBuB,CAAlB,CAAf"}
|
|
@@ -27,7 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
-
function _extends() { _extends = Object.assign
|
|
30
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
31
|
|
|
32
32
|
function BottomTabView(props) {
|
|
33
33
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomTabView.tsx"],"names":["BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","Platform","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","React","useState","includes","dimensions","SafeAreaProviderCompat","initialMetrics","frame","tabBarHeight","setTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","name","headerShown","headerStatusBarHeight","headerTransparent","StyleSheet","absoluteFill","zIndex","render","create","flex","overflow"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AACA;;AAUA;;AACA;;AACA;;AACA;;;;;;;;;;AAQe,SAASA,aAAT,CAAuBC,KAAvB,EAAqC;AAClD,QAAM;AACJC,IAAAA,MAAM,GAAID,KAAD,iBAA8B,oBAAC,qBAAD,EAAkBA,KAAlB,CADnC;AAEJE,IAAAA,KAFI;AAGJC,IAAAA,UAHI;AAIJC,IAAAA,WAJI;AAKJC,IAAAA,cALI;AAMJC,IAAAA,qBAAqB,GAAGC,sBAASC,EAAT,KAAgB,KAAhB,IACtBD,sBAASC,EAAT,KAAgB,SADM,IAEtBD,sBAASC,EAAT,KAAgB,KARd;AASJC,IAAAA;AATI,MAUFT,KAVJ;AAYA,QAAMU,eAAe,GAAGR,KAAK,CAACS,MAAN,CAAaT,KAAK,CAACU,KAAnB,EAA0BC,GAAlD;AACA,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBC,KAAK,CAACC,QAAN,CAAe,CAACP,eAAD,CAAf,CAA5B;;AAEA,MAAI,CAACI,MAAM,CAACI,QAAP,CAAgBR,eAAhB,CAAL,EAAuC;AACrCK,IAAAA,SAAS,CAAC,CAAC,GAAGD,MAAJ,EAAYJ,eAAZ,CAAD,CAAT;AACD;;AAED,QAAMS,UAAU,GAAGC,iCAAuBC,cAAvB,CAAsCC,KAAzD;AACA,QAAM,CAACC,YAAD,EAAeC,eAAf,IAAkCR,KAAK,CAAC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eAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n TabNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform, StyleSheet } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nimport type {\n BottomTabBarProps,\n BottomTabDescriptorMap,\n BottomTabHeaderProps,\n BottomTabNavigationConfig,\n BottomTabNavigationHelpers,\n BottomTabNavigationProp,\n} from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport BottomTabBarHeightContext from '../utils/BottomTabBarHeightContext';\nimport BottomTabBar, { getTabBarHeight } from './BottomTabBar';\nimport { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';\n\ntype Props = BottomTabNavigationConfig & {\n state: TabNavigationState<ParamListBase>;\n navigation: BottomTabNavigationHelpers;\n descriptors: BottomTabDescriptorMap;\n};\n\nexport default function BottomTabView(props: Props) {\n const {\n tabBar = (props: BottomTabBarProps) => <BottomTabBar {...props} />,\n state,\n navigation,\n descriptors,\n safeAreaInsets,\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n sceneContainerStyle,\n } = props;\n\n const focusedRouteKey = state.routes[state.index].key;\n const [loaded, setLoaded] = React.useState([focusedRouteKey]);\n\n if (!loaded.includes(focusedRouteKey)) {\n setLoaded([...loaded, focusedRouteKey]);\n }\n\n const dimensions = SafeAreaProviderCompat.initialMetrics.frame;\n const [tabBarHeight, setTabBarHeight] = React.useState(() =>\n getTabBarHeight({\n state,\n descriptors,\n dimensions,\n layout: { width: dimensions.width, height: 0 },\n insets: {\n ...SafeAreaProviderCompat.initialMetrics.insets,\n ...props.safeAreaInsets,\n },\n style: descriptors[state.routes[state.index].key].options.tabBarStyle,\n })\n );\n\n const renderTabBar = () => {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) =>\n tabBar({\n state: state,\n descriptors: descriptors,\n navigation: navigation,\n insets: {\n top: safeAreaInsets?.top ?? insets?.top ?? 0,\n right: safeAreaInsets?.right ?? insets?.right ?? 0,\n bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,\n left: safeAreaInsets?.left ?? insets?.left ?? 0,\n },\n })\n }\n </SafeAreaInsetsContext.Consumer>\n );\n };\n\n const { routes } = state;\n\n return (\n <SafeAreaProviderCompat>\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n hasTwoStates\n style={styles.container}\n >\n {routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const { lazy = true, unmountOnBlur } = descriptor.options;\n const isFocused = state.index === index;\n\n if (unmountOnBlur && !isFocused) {\n return null;\n }\n\n if (lazy && !loaded.includes(route.key) && !isFocused) {\n // Don't render a lazy screen if we've never navigated to it\n return null;\n }\n\n const {\n freezeOnBlur,\n header = ({ layout, options }: BottomTabHeaderProps) => (\n <Header\n {...options}\n layout={layout}\n title={getHeaderTitle(options, route.name)}\n />\n ),\n headerShown,\n headerStatusBarHeight,\n headerTransparent,\n } = descriptor.options;\n\n return (\n <MaybeScreen\n key={route.key}\n style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}\n visible={isFocused}\n enabled={detachInactiveScreens}\n freezeOnBlur={freezeOnBlur}\n >\n <BottomTabBarHeightContext.Provider value={tabBarHeight}>\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={headerShown}\n headerStatusBarHeight={headerStatusBarHeight}\n headerTransparent={headerTransparent}\n header={header({\n layout: dimensions,\n route: descriptor.route,\n navigation:\n descriptor.navigation as BottomTabNavigationProp<ParamListBase>,\n options: descriptor.options,\n })}\n style={sceneContainerStyle}\n >\n {descriptor.render()}\n </Screen>\n </BottomTabBarHeightContext.Provider>\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n <BottomTabBarHeightCallbackContext.Provider value={setTabBarHeight}>\n {renderTabBar()}\n </BottomTabBarHeightCallbackContext.Provider>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","Platform","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","React","useState","includes","dimensions","SafeAreaProviderCompat","initialMetrics","frame","tabBarHeight","setTabBarHeight","getTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","getHeaderTitle","name","headerShown","headerStatusBarHeight","headerTransparent","StyleSheet","absoluteFill","zIndex","render","create","flex","overflow"],"sources":["BottomTabView.tsx"],"sourcesContent":["import {\n getHeaderTitle,\n Header,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n TabNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform, StyleSheet } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nimport type {\n BottomTabBarProps,\n BottomTabDescriptorMap,\n BottomTabHeaderProps,\n BottomTabNavigationConfig,\n BottomTabNavigationHelpers,\n BottomTabNavigationProp,\n} from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport BottomTabBarHeightContext from '../utils/BottomTabBarHeightContext';\nimport BottomTabBar, { getTabBarHeight } from './BottomTabBar';\nimport { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';\n\ntype Props = BottomTabNavigationConfig & {\n state: TabNavigationState<ParamListBase>;\n navigation: BottomTabNavigationHelpers;\n descriptors: BottomTabDescriptorMap;\n};\n\nexport default function BottomTabView(props: Props) {\n const {\n tabBar = (props: BottomTabBarProps) => <BottomTabBar {...props} />,\n state,\n navigation,\n descriptors,\n safeAreaInsets,\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n sceneContainerStyle,\n } = props;\n\n const focusedRouteKey = state.routes[state.index].key;\n const [loaded, setLoaded] = React.useState([focusedRouteKey]);\n\n if (!loaded.includes(focusedRouteKey)) {\n setLoaded([...loaded, focusedRouteKey]);\n }\n\n const dimensions = SafeAreaProviderCompat.initialMetrics.frame;\n const [tabBarHeight, setTabBarHeight] = React.useState(() =>\n getTabBarHeight({\n state,\n descriptors,\n dimensions,\n layout: { width: dimensions.width, height: 0 },\n insets: {\n ...SafeAreaProviderCompat.initialMetrics.insets,\n ...props.safeAreaInsets,\n },\n style: descriptors[state.routes[state.index].key].options.tabBarStyle,\n })\n );\n\n const renderTabBar = () => {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) =>\n tabBar({\n state: state,\n descriptors: descriptors,\n navigation: navigation,\n insets: {\n top: safeAreaInsets?.top ?? insets?.top ?? 0,\n right: safeAreaInsets?.right ?? insets?.right ?? 0,\n bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,\n left: safeAreaInsets?.left ?? insets?.left ?? 0,\n },\n })\n }\n </SafeAreaInsetsContext.Consumer>\n );\n };\n\n const { routes } = state;\n\n return (\n <SafeAreaProviderCompat>\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n hasTwoStates\n style={styles.container}\n >\n {routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const { lazy = true, unmountOnBlur } = descriptor.options;\n const isFocused = state.index === index;\n\n if (unmountOnBlur && !isFocused) {\n return null;\n }\n\n if (lazy && !loaded.includes(route.key) && !isFocused) {\n // Don't render a lazy screen if we've never navigated to it\n return null;\n }\n\n const {\n freezeOnBlur,\n header = ({ layout, options }: BottomTabHeaderProps) => (\n <Header\n {...options}\n layout={layout}\n title={getHeaderTitle(options, route.name)}\n />\n ),\n headerShown,\n headerStatusBarHeight,\n headerTransparent,\n } = descriptor.options;\n\n return (\n <MaybeScreen\n key={route.key}\n style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}\n visible={isFocused}\n enabled={detachInactiveScreens}\n freezeOnBlur={freezeOnBlur}\n >\n <BottomTabBarHeightContext.Provider value={tabBarHeight}>\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={headerShown}\n headerStatusBarHeight={headerStatusBarHeight}\n headerTransparent={headerTransparent}\n header={header({\n layout: dimensions,\n route: descriptor.route,\n navigation:\n descriptor.navigation as BottomTabNavigationProp<ParamListBase>,\n options: descriptor.options,\n })}\n style={sceneContainerStyle}\n >\n {descriptor.render()}\n </Screen>\n </BottomTabBarHeightContext.Provider>\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n <BottomTabBarHeightCallbackContext.Provider value={setTabBarHeight}>\n {renderTabBar()}\n </BottomTabBarHeightCallbackContext.Provider>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AACA;;AAUA;;AACA;;AACA;;AACA;;;;;;;;;;AAQe,SAASA,aAAT,CAAuBC,KAAvB,EAAqC;EAClD,MAAM;IACJC,MAAM,GAAID,KAAD,iBAA8B,oBAAC,qBAAD,EAAkBA,KAAlB,CADnC;IAEJE,KAFI;IAGJC,UAHI;IAIJC,WAJI;IAKJC,cALI;IAMJC,qBAAqB,GAAGC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,IACtBD,qBAAA,CAASC,EAAT,KAAgB,SADM,IAEtBD,qBAAA,CAASC,EAAT,KAAgB,KARd;IASJC;EATI,IAUFT,KAVJ;EAYA,MAAMU,eAAe,GAAGR,KAAK,CAACS,MAAN,CAAaT,KAAK,CAACU,KAAnB,EAA0BC,GAAlD;EACA,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBC,KAAK,CAACC,QAAN,CAAe,CAACP,eAAD,CAAf,CAA5B;;EAEA,IAAI,CAACI,MAAM,CAACI,QAAP,CAAgBR,eAAhB,CAA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X,OAZf;IAcA,oBACE,oBAAC,2BAAD;MACE,GAAG,EAAEU,KAAK,CAAC5B,GADb;MAEE,KAAK,EAAE,CAACwC,uBAAA,CAAWC,YAAZ,EAA0B;QAAEC,MAAM,EAAEV,SAAS,GAAG,CAAH,GAAO,CAAC;MAA3B,CAA1B,CAFT;MAGE,OAAO,EAAEA,SAHX;MAIE,OAAO,EAAEvC,qBAJX;MAKE,YAAY,EAAEwC;IALhB,gBAOE,oBAAC,kCAAD,CAA2B,QAA3B;MAAoC,KAAK,EAAEvB;IAA3C,gBACE,oBAAC,gBAAD;MACE,OAAO,EAAEsB,SADX;MAEE,KAAK,EAAEH,UAAU,CAACD,KAFpB;MAGE,UAAU,EAAEC,UAAU,CAACvC,UAHzB;MAIE,WAAW,EAAE+C,WAJf;MAKE,qBAAqB,EAAEC,qBALzB;MAME,iBAAiB,EAAEC,iBANrB;MAOE,MAAM,EAAEL,MAAM,CAAC;QACbrB,MAAM,EAAEP,UADK;QAEbsB,KAAK,EAAEC,UAAU,CAACD,KAFL;QAGbtC,UAAU,EACRuC,UAAU,CAACvC,UAJA;QAKb4B,OAAO,EAAEW,UAAU,CAACX;MALP,CAAD,CAPhB;MAcE,KAAK,EAAEtB;IAdT,GAgBGiC,UAAU,CAACc,MAAX,EAhBH,CADF,CAPF,CADF;EA8BD,CA1DA,CALH,CADF,eAkEE,oBAAC,0CAAD,CAAmC,QAAnC;IAA4C,KAAK,EAAEhC;EAAnD,GACGS,YAAY,EADf,CAlEF,CADF;AAwED;;AAED,MAAMK,MAAM,GAAGe,uBAAA,CAAWI,MAAX,CAAkB;EAC/BlB,SAAS,EAAE;IACTmB,IAAI,EAAE,CADG;IAETC,QAAQ,EAAE;EAFD;AADoB,CAAlB,CAAf"}
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
18
|
|
|
19
|
-
function _extends() { _extends = Object.assign
|
|
19
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
20
|
|
|
21
21
|
let Screens;
|
|
22
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sources":["ScreenFallback.tsx"],"sourcesContent":["import { ResourceSavingView } from '@react-navigation/elements';\nimport * as React from 'react';\nimport { StyleProp, View, ViewProps, ViewStyle } from 'react-native';\n\ntype Props = {\n visible: boolean;\n children: React.ReactNode;\n enabled: boolean;\n freezeOnBlur?: boolean;\n style?: StyleProp<ViewStyle>;\n};\n\nlet Screens: typeof import('react-native-screens') | undefined;\n\ntry {\n Screens = require('react-native-screens');\n} catch (e) {\n // Ignore\n}\n\nexport const MaybeScreenContainer = ({\n enabled,\n ...rest\n}: ViewProps & {\n enabled: boolean;\n hasTwoStates: boolean;\n children: React.ReactNode;\n}) => {\n if (Screens?.screensEnabled?.()) {\n return <Screens.ScreenContainer enabled={enabled} {...rest} />;\n }\n\n return <View {...rest} />;\n};\n\nexport function MaybeScreen({ visible, children, ...rest }: Props) {\n if (Screens?.screensEnabled?.()) {\n return (\n <Screens.Screen activityState={visible ? 2 : 0} {...rest}>\n {children}\n </Screens.Screen>\n );\n }\n\n return (\n <ResourceSavingView visible={visible} {...rest}>\n {children}\n </ResourceSavingView>\n );\n}\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAUA,IAAIA,OAAJ;;AAEA,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAD,CAAjB;AACD,CAFD,CAEE,OAAOC,CAAP,EAAU,CACV;AACD;;AAEM,MAAMC,oBAAoB,GAAG,QAO9B;EAAA;;EAAA,IAP+B;IACnCC,OADmC;IAEnC,GAAGC;EAFgC,CAO/B;;EACJ,gBAAIL,OAAJ,8DAAI,SAASM,cAAb,kDAAI,oCAAJ,EAAiC;IAC/B,oBAAO,oBAAC,OAAD,CAAS,eAAT;MAAyB,OAAO,EAAEF;IAAlC,GAA+CC,IAA/C,EAAP;EACD;;EAED,oBAAO,oBAAC,iBAAD,EAAUA,IAAV,CAAP;AACD,CAbM;;;;AAeA,SAASE,WAAT,QAA4D;EAAA;;EAAA,IAAvC;IAAEC,OAAF;IAAWC,QAAX;IAAqB,GAAGJ;EAAxB,CAAuC;;EACjE,iBAAIL,OAAJ,+DAAI,UAASM,cAAb,kDAAI,qCAAJ,EAAiC;IAC/B,oBACE,oBAAC,OAAD,CAAS,MAAT;MAAgB,aAAa,EAAEE,OAAO,GAAG,CAAH,GAAO;IAA7C,GAAoDH,IAApD,GACGI,QADH,CADF;EAKD;;EAED,oBACE,oBAAC,4BAAD;IAAoB,OAAO,EAAED;EAA7B,GAA0CH,IAA1C,GACGI,QADH,CADF;AAKD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["TabBarIcon","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","size","styles","iconHorizontal","iconVertical","icon","opacity","focused","color","badgeHorizontal","badgeVertical","StyleSheet","create","position","alignSelf","alignItems","justifyContent","height","width","minWidth","flex","marginTop","left","top"],"sources":["TabBarIcon.tsx"],"sourcesContent":["import type { Route } from '@react-navigation/native';\nimport React from 'react';\nimport {\n StyleProp,\n StyleSheet,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport Badge from './Badge';\n\ntype Props = {\n route: Route<string>;\n horizontal: boolean;\n badge?: string | number;\n badgeStyle?: StyleProp<TextStyle>;\n activeOpacity: number;\n inactiveOpacity: number;\n activeTintColor: string;\n inactiveTintColor: string;\n renderIcon: (props: {\n focused: boolean;\n color: string;\n size: number;\n }) => React.ReactNode;\n style: StyleProp<ViewStyle>;\n};\n\nexport default function TabBarIcon({\n route: _,\n horizontal,\n badge,\n badgeStyle,\n activeOpacity,\n inactiveOpacity,\n activeTintColor,\n inactiveTintColor,\n renderIcon,\n style,\n}: Props) {\n const size = 25;\n\n // We render the icon twice at the same position on top of each other:\n // active and inactive one, so we can fade between them.\n return (\n <View\n style={[horizontal ? styles.iconHorizontal : styles.iconVertical, style]}\n >\n <View style={[styles.icon, { opacity: activeOpacity }]}>\n {renderIcon({\n focused: true,\n size,\n color: activeTintColor,\n })}\n </View>\n <View style={[styles.icon, { opacity: inactiveOpacity }]}>\n {renderIcon({\n focused: false,\n size,\n color: inactiveTintColor,\n })}\n </View>\n <Badge\n visible={badge != null}\n style={[\n styles.badge,\n horizontal ? styles.badgeHorizontal : styles.badgeVertical,\n badgeStyle,\n ]}\n size={(size * 3) / 4}\n >\n {badge}\n </Badge>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n icon: {\n // We render the icon twice at the same position on top of each other:\n // active and inactive one, so we can fade between them:\n // Cover the whole iconContainer:\n position: 'absolute',\n alignSelf: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%',\n width: '100%',\n // Workaround for react-native >= 0.54 layout bug\n minWidth: 25,\n },\n iconVertical: {\n flex: 1,\n },\n iconHorizontal: {\n height: '100%',\n marginTop: 3,\n },\n badge: {\n position: 'absolute',\n left: 3,\n },\n badgeVertical: {\n top: 3,\n },\n badgeHorizontal: {\n top: 7,\n },\n});\n"],"mappings":";;;;;;;AACA;;AACA;;AAQA;;;;AAmBe,SAASA,UAAT,OAWL;EAAA,IAXyB;IACjCC,KAAK,EAAEC,CAD0B;IAEjCC,UAFiC;IAGjCC,KAHiC;IAIjCC,UAJiC;IAKjCC,aALiC;IAMjCC,eANiC;IAOjCC,eAPiC;IAQjCC,iBARiC;IASjCC,UATiC;IAUjCC;EAViC,CAWzB;EACR,MAAMC,IAAI,GAAG,EAAb,CADQ,CAGR;EACA;;EACA,oBACE,6BAAC,iBAAD;IACE,KAAK,EAAE,CAACT,UAAU,GAAGU,MAAM,CAACC,cAAV,GAA2BD,MAAM,CAACE,YAA7C,EAA2DJ,KAA3D;EADT,gBAGE,6BAAC,iBAAD;IAAM,KAAK,EAAE,CAACE,MAAM,CAACG,IAAR,EAAc;MAAEC,OAAO,EAAEX;IAAX,CAAd;EAAb,GACGI,UAAU,CAAC;IACVQ,OAAO,EAAE,IADC;IAEVN,IAFU;IAGVO,KAAK,EAAEX;EAHG,CAAD,CADb,CAHF,eAUE,6BAAC,iBAAD;IAAM,KAAK,EAAE,CAACK,MAAM,CAACG,IAAR,EAAc;MAAEC,OAAO,EAAEV;IAAX,CAAd;EAAb,GACGG,UAAU,CAAC;IACVQ,OAAO,EAAE,KADC;IAEVN,IAFU;IAGVO,KAAK,EAAEV;EAHG,CAAD,CADb,CAVF,eAiBE,6BAAC,cAAD;IACE,OAAO,EAAEL,KAAK,IAAI,IADpB;IAEE,KAAK,EAAE,CACLS,MAAM,CAACT,KADF,EAELD,UAAU,GAAGU,MAAM,CAACO,eAAV,GAA4BP,MAAM,CAACQ,aAFxC,EAGLhB,UAHK,CAFT;IAOE,IAAI,EAAGO,IAAI,GAAG,CAAR,GAAa;EAPrB,GASGR,KATH,CAjBF,CADF;AA+BD;;AAED,MAAMS,MAAM,GAAGS,uBAAA,CAAWC,MAAX,CAAkB;EAC/BP,IAAI,EAAE;IACJ;IACA;IACA;IACAQ,QAAQ,EAAE,UAJN;IAKJC,SAAS,EAAE,QALP;IAMJC,UAAU,EAAE,QANR;IAOJC,cAAc,EAAE,QAPZ;IAQJC,MAAM,EAAE,MARJ;IASJC,KAAK,EAAE,MATH;IAUJ;IACAC,QAAQ,EAAE;EAXN,CADyB;EAc/Bf,YAAY,EAAE;IACZgB,IAAI,EAAE;EADM,CAdiB;EAiB/BjB,cAAc,EAAE;IACdc,MAAM,EAAE,MADM;IAEdI,SAAS,EAAE;EAFG,CAjBe;EAqB/B5B,KAAK,EAAE;IACLoB,QAAQ,EAAE,UADL;IAELS,IAAI,EAAE;EAFD,CArBwB;EAyB/BZ,aAAa,EAAE;IACba,GAAG,EAAE;EADQ,CAzBgB;EA4B/Bd,eAAe,EAAE;IACfc,GAAG,EAAE;EADU;AA5Bc,CAAlB,CAAf"}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["default","createBottomTabNavigator","BottomTabBar","BottomTabView","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","useBottomTabBarHeight"],"sources":["index.tsx"],"sourcesContent":["/**\n * Navigators\n */\nexport { default as createBottomTabNavigator } from './navigators/createBottomTabNavigator';\n\n/**\n * Views\n */\nexport { default as BottomTabBar } from './views/BottomTabBar';\nexport { default as BottomTabView } from './views/BottomTabView';\n\n/**\n * Utilities\n */\nexport { default as BottomTabBarHeightCallbackContext } from './utils/BottomTabBarHeightCallbackContext';\nexport { default as BottomTabBarHeightContext } from './utils/BottomTabBarHeightContext';\nexport { default as useBottomTabBarHeight } from './utils/useBottomTabBarHeight';\n\n/**\n * Types\n */\nexport type {\n BottomTabBarButtonProps,\n BottomTabBarProps,\n BottomTabHeaderProps,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n BottomTabNavigationProp,\n BottomTabScreenProps,\n} from './types';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,wBAApB,QAAoD,uCAApD;AAEA;AACA;AACA;;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,sBAAxC;AACA,SAASF,OAAO,IAAIG,aAApB,QAAyC,uBAAzC;AAEA;AACA;AACA;;AACA,SAASH,OAAO,IAAII,iCAApB,QAA6D,2CAA7D;AACA,SAASJ,OAAO,IAAIK,yBAApB,QAAqD,mCAArD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+BAAjD;AAEA;AACA;AACA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import { createNavigatorFactory, TabRouter, useNavigationBuilder } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","React","warnOnce","BottomTabView","BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","JSON","stringify","state","descriptors","navigation","NavigationContent"],"sources":["createBottomTabNavigator.tsx"],"sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n ParamListBase,\n TabActionHelpers,\n TabNavigationState,\n TabRouter,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n BottomTabNavigationConfig,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n} from '../types';\nimport BottomTabView from '../views/BottomTabView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabRouterOptions &\n BottomTabNavigationConfig;\n\nfunction BottomTabNavigator({\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n sceneContainerStyle,\n ...restWithDeprecated\n}: Props) {\n const {\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: tabBarOptions is deprecated\n tabBarOptions,\n ...rest\n } = restWithDeprecated;\n\n let defaultScreenOptions: BottomTabNavigationOptions = {};\n\n if (tabBarOptions) {\n Object.assign(defaultScreenOptions, {\n tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,\n tabBarActiveTintColor: tabBarOptions.activeTintColor,\n tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,\n tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,\n tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,\n tabBarAllowFontScaling: tabBarOptions.allowFontScaling,\n tabBarShowLabel: tabBarOptions.showLabel,\n tabBarLabelStyle: tabBarOptions.labelStyle,\n tabBarIconStyle: tabBarOptions.iconStyle,\n tabBarItemStyle: tabBarOptions.tabStyle,\n tabBarLabelPosition:\n tabBarOptions.labelPosition ??\n (tabBarOptions.adaptive === false ? 'below-icon' : undefined),\n tabBarStyle: [\n { display: tabBarOptions.tabBarVisible ? 'none' : 'flex' },\n defaultScreenOptions.tabBarStyle,\n ],\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof BottomTabNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n tabBarOptions,\n `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\\n\\nPlace the following in 'screenOptions' in your code to keep current behavior:\\n\\n${JSON.stringify(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`\n );\n }\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n TabActionHelpers<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n >(TabRouter, {\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <BottomTabView\n {...rest}\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n sceneContainerStyle={sceneContainerStyle}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap,\n typeof BottomTabNavigator\n>(BottomTabNavigator);\n"],"mappings":";;AAAA,SACEA,sBADF,EAMEC,SANF,EAQEC,oBARF,QASO,0BATP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,QAAP,MAAqB,WAArB;AAOA,OAAOC,aAAP,MAA0B,wB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OAAO1B,oBAAoB,CAACgC,GAAD,CAA3B;MACD;IACF,CAPD;IASA9C,QAAQ,CACNY,aADM,EAEL,4LAA2LmC,IAAI,CAACC,SAAL,CAC1LlC,oBAD0L,EAE1L,IAF0L,EAG1L,CAH0L,CAI1L,yFANI,CAAR;EAQD;;EAED,IAAI,OAAOH,IAAP,KAAgB,SAApB,EAA+B;IAC7BG,oBAAoB,CAACH,IAArB,GAA4BA,IAA5B;IAEAX,QAAQ,CACN,IADM,EAEL,+KAFK,CAAR;EAID;;EAED,MAAM;IAAEiD,KAAF;IAASC,WAAT;IAAsBC,UAAtB;IAAkCC;EAAlC,IACJtD,oBAAoB,CAMlBD,SANkB,EAMP;IACXM,EADW;IAEXC,gBAFW;IAGXC,YAHW;IAIXC,QAJW;IAKXC,eALW;IAMXC,aANW;IAOXM;EAPW,CANO,CADtB;EAiBA,oBACE,oBAAC,iBAAD,qBACE,oBAAC,aAAD,eACMD,IADN;IAEE,KAAK,EAAEoC,KAFT;IAGE,UAAU,EAAEE,UAHd;IAIE,WAAW,EAAED,WAJf;IAKE,mBAAmB,EAAEzC;EALvB,GADF,CADF;AAWD;;AAED,eAAeb,sBAAsB,CAKnCM,kBALmC,CAArC"}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type { HeaderOptions } from '@react-navigation/elements';\nimport type {\n Descriptor,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n RouteProp,\n TabActionHelpers,\n TabNavigationState,\n} from '@react-navigation/native';\nimport type * as React from 'react';\nimport type {\n Animated,\n GestureResponderEvent,\n StyleProp,\n TextStyle,\n TouchableWithoutFeedbackProps,\n ViewStyle,\n} from 'react-native';\nimport type { EdgeInsets } from 'react-native-safe-area-context';\n\nexport type Layout = { width: number; height: number };\n\nexport type BottomTabNavigationEventMap = {\n /**\n * Event which fires on tapping on the tab in the tab bar.\n */\n tabPress: { data: undefined; canPreventDefault: true };\n /**\n * Event which fires on long press on the tab in the tab bar.\n */\n tabLongPress: { data: undefined };\n};\n\nexport type LabelPosition = 'beside-icon' | 'below-icon';\n\nexport type BottomTabNavigationHelpers = NavigationHelpers<\n ParamListBase,\n BottomTabNavigationEventMap\n> &\n TabActionHelpers<ParamListBase>;\n\nexport type BottomTabNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n TabNavigationState<ParamList>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabActionHelpers<ParamList>;\n\nexport type BottomTabScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = {\n navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;\n route: RouteProp<ParamList, RouteName>;\n};\n\nexport type TimingKeyboardAnimationConfig = {\n animation: 'timing';\n config?: Omit<\n Partial<Animated.TimingAnimationConfig>,\n 'toValue' | 'useNativeDriver'\n >;\n};\n\nexport type SpringKeyboardAnimationConfig = {\n animation: 'spring';\n config?: Omit<\n Partial<Animated.SpringAnimationConfig>,\n 'toValue' | 'useNativeDriver'\n >;\n};\n\nexport type TabBarVisibilityAnimationConfig =\n | TimingKeyboardAnimationConfig\n | SpringKeyboardAnimationConfig;\n\nexport type BottomTabNavigationOptions = HeaderOptions & {\n /**\n * Title text for the screen.\n */\n title?: string;\n\n /**\n * Title string of a tab displayed in the tab bar\n * or a function that given { focused: boolean, color: string, position: 'below-icon' | 'beside-icon' } returns a React.Node to display in tab bar.\n *\n * When undefined, scene title is used. Use `tabBarShowLabel` to hide the label.\n */\n tabBarLabel?:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n\n /**\n * Whether the tab label should be visible. Defaults to `true`.\n */\n tabBarShowLabel?: boolean;\n\n /**\n * Whether the label is shown below the icon or beside the icon.\n *\n * - `below-icon`: the label is shown below the icon (typical for iPhones)\n * - `beside-icon` the label is shown next to the icon (typical for iPad)\n *\n * By default, the position is chosen automatically based on device width.\n */\n tabBarLabelPosition?: LabelPosition;\n\n /**\n * Style object for the tab label.\n */\n tabBarLabelStyle?: StyleProp<TextStyle>;\n\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n tabBarAllowFontScaling?: boolean;\n\n /**\n * A function that given { focused: boolean, color: string } returns a React.Node to display in the tab bar.\n */\n tabBarIcon?: (props: {\n focused: boolean;\n color: string;\n size: number;\n }) => React.ReactNode;\n\n /**\n * Style object for the tab icon.\n */\n tabBarIconStyle?: StyleProp<TextStyle>;\n\n /**\n * Text to show in a badge on the tab icon.\n */\n tabBarBadge?: number | string;\n\n /**\n * Custom style for the tab bar badge.\n * You can specify a background color or text color here.\n */\n tabBarBadgeStyle?: StyleProp<TextStyle>;\n\n /**\n * Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.\n * It's recommended to set this if you don't have a label for the tab.\n */\n tabBarAccessibilityLabel?: string;\n\n /**\n * ID to locate this tab button in tests.\n */\n tabBarTestID?: string;\n\n /**\n * Function which returns a React element to render as the tab bar button.\n * Renders `Pressable` by default.\n */\n tabBarButton?: (props: BottomTabBarButtonProps) => React.ReactNode;\n\n /**\n * Color for the icon and label in the active tab.\n */\n tabBarActiveTintColor?: string;\n\n /**\n * Color for the icon and label in the inactive tabs.\n */\n tabBarInactiveTintColor?: string;\n\n /**\n * Background color for the active tab.\n */\n tabBarActiveBackgroundColor?: string;\n\n /**\n * Background color for the inactive tabs.\n */\n tabBarInactiveBackgroundColor?: string;\n\n /**\n * Style object for the tab item container.\n */\n tabBarItemStyle?: StyleProp<ViewStyle>;\n\n /**\n * Whether the tab bar gets hidden when the keyboard is shown. Defaults to `false`.\n */\n tabBarHideOnKeyboard?: boolean;\n\n /**\n * Animation config for showing and hiding the tab bar when the keyboard is shown/hidden.\n */\n tabBarVisibilityAnimationConfig?: {\n show?: TabBarVisibilityAnimationConfig;\n hide?: TabBarVisibilityAnimationConfig;\n };\n\n /**\n * Style object for the tab bar container.\n */\n tabBarStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n\n /**\n * Function which returns a React Element to use as background for the tab bar.\n * You could render an image, a gradient, blur view etc.\n *\n * When using `BlurView`, make sure to set `position: 'absolute'` in `tabBarStyle` as well.\n * You'd also need to use `useBottomTabBarHeight()` to add a bottom padding to your content.\n */\n tabBarBackground?: () => React.ReactNode;\n\n /**\n * Whether this screens should render the first time it's accessed. Defaults to `true`.\n * Set it to `false` if you want to render the screen on initial render.\n */\n lazy?: boolean;\n\n /**\n * Function that given returns a React Element to display as a header.\n */\n header?: (props: BottomTabHeaderProps) => React.ReactNode;\n\n /**\n * Whether to show the header. Setting this to `false` hides the header.\n * Defaults to `true`.\n */\n headerShown?: boolean;\n\n /**\n * Whether this screen should be unmounted when navigating away from it.\n * Defaults to `false`.\n */\n unmountOnBlur?: boolean;\n\n /**\n * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.\n * Defaults to `true` when `enableFreeze()` is run at the top of the application.\n * Requires `react-native-screens` version >=3.16.0.\n *\n * Only supported on iOS and Android.\n */\n freezeOnBlur?: boolean;\n};\n\nexport type BottomTabDescriptor = Descriptor<\n BottomTabNavigationOptions,\n BottomTabNavigationProp<ParamListBase>,\n RouteProp<ParamListBase>\n>;\n\nexport type BottomTabDescriptorMap = Record<string, BottomTabDescriptor>;\n\nexport type BottomTabNavigationConfig = {\n /**\n * Function that returns a React element to display as the tab bar.\n */\n tabBar?: (props: BottomTabBarProps) => React.ReactNode;\n /**\n * Safe area insets for the tab bar. This is used to avoid elements like the navigation bar on Android and bottom safe area on iOS.\n * By default, the device's safe area insets are automatically detected. You can override the behavior with this option.\n */\n safeAreaInsets?: {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n };\n /**\n * Whether inactive screens should be detached from the view hierarchy to save memory.\n * Make sure to call `enableScreens` from `react-native-screens` to make it work.\n * Defaults to `true` on Android.\n */\n detachInactiveScreens?: boolean;\n /**\n * Style object for the component wrapping the screen content.\n */\n sceneContainerStyle?: StyleProp<ViewStyle>;\n};\n\nexport type BottomTabHeaderProps = {\n /**\n * Layout of the screen.\n */\n layout: Layout;\n /**\n * Options for the current screen.\n */\n options: BottomTabNavigationOptions;\n /**\n * Route object for the current screen.\n */\n route: RouteProp<ParamListBase>;\n /**\n * Navigation prop for the header.\n */\n navigation: BottomTabNavigationProp<ParamListBase>;\n};\n\nexport type BottomTabBarProps = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n navigation: NavigationHelpers<ParamListBase, BottomTabNavigationEventMap>;\n insets: EdgeInsets;\n};\n\nexport type BottomTabBarButtonProps = Omit<\n TouchableWithoutFeedbackProps,\n 'onPress'\n> & {\n to?: string;\n children: React.ReactNode;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sources":["BottomTabBarHeightCallbackContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<((height: number) => void) | undefined>(\n undefined\n);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,4BAAeA,KAAK,CAACC,aAAN,CACbC,SADa,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sources":["BottomTabBarHeightContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport default React.createContext<number | undefined>(undefined);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,4BAAeA,KAAK,CAACC,aAAN,CAAwCC,SAAxC,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","BottomTabBarHeightContext","useFloatingBottomTabBarHeight","height","useContext","undefined","Error"],"sources":["useBottomTabBarHeight.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport BottomTabBarHeightContext from './BottomTabBarHeightContext';\n\nexport default function useFloatingBottomTabBarHeight() {\n const height = React.useContext(BottomTabBarHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?\"\n );\n }\n\n return height;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,yBAAP,MAAsC,6BAAtC;AAEA,eAAe,SAASC,6BAAT,GAAyC;EACtD,MAAMC,MAAM,GAAGH,KAAK,CAACI,UAAN,CAAiBH,yBAAjB,CAAf;;EAEA,IAAIE,MAAM,KAAKE,SAAf,EAA0B;IACxB,MAAM,IAAIC,KAAJ,CACJ,2FADI,CAAN;EAGD;;EAED,OAAOH,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","Keyboard","Platform","useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","OS","addListener","forEach","s","remove"],"sources":["useIsKeyboardShown.tsx"],"sourcesContent":["import * as React from 'react';\nimport { EmitterSubscription, Keyboard, Platform } from 'react-native';\n\nexport default function useIsKeyboardShown() {\n const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);\n\n React.useEffect(() => {\n const handleKeyboardShow = () => setIsKeyboardShown(true);\n const handleKeyboardHide = () => setIsKeyboardShown(false);\n\n let subscriptions: EmitterSubscription[];\n\n if (Platform.OS === 'ios') {\n subscriptions = [\n Keyboard.addListener('keyboardWillShow', handleKeyboardShow),\n Keyboard.addListener('keyboardWillHide', handleKeyboardHide),\n ];\n } else {\n subscriptions = [\n Keyboard.addListener('keyboardDidShow', handleKeyboardShow),\n Keyboard.addListener('keyboardDidHide', handleKeyboardHide),\n ];\n }\n\n return () => {\n subscriptions.forEach((s) => s.remove());\n };\n }, []);\n\n return isKeyboardShown;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAA8BC,QAA9B,EAAwCC,QAAxC,QAAwD,cAAxD;AAEA,eAAe,SAASC,kBAAT,GAA8B;EAC3C,MAAM,CAACC,eAAD,EAAkBC,kBAAlB,IAAwCL,KAAK,CAACM,QAAN,CAAe,KAAf,CAA9C;EAEAN,KAAK,CAACO,SAAN,CAAgB,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMH,kBAAkB,CAAC,IAAD,CAAnD;;IACA,MAAMI,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,KAAD,CAAnD;;IAEA,IAAIK,aAAJ;;IAEA,IAAIR,QAAQ,CAACS,EAAT,KAAgB,KAApB,EAA2B;MACzBD,aAAa,GAAG,CACdT,QAAQ,CAACW,WAAT,CAAqB,kBAArB,EAAyCJ,kBAAzC,CADc,EAEdP,QAAQ,CAACW,WAAT,CAAqB,kBAArB,EAAyCH,kBAAzC,CAFc,CAAhB;IAID,CALD,MAKO;MACLC,aAAa,GAAG,CACdT,QAAQ,CAACW,WAAT,CAAqB,iBAArB,EAAwCJ,kBAAxC,CADc,EAEdP,QAAQ,CAACW,WAAT,CAAqB,iBAArB,EAAwCH,kBAAxC,CAFc,CAAhB;IAID;;IAED,OAAO,MAAM;MACXC,aAAa,CAACG,OAAd,CAAuBC,CAAD,IAAOA,CAAC,CAACC,MAAF,EAA7B;IACD,CAFD;EAGD,CArBD,EAqBG,EArBH;EAuBA,OAAOX,eAAP;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import { useTheme } from '@react-navigation/native';
|
|
4
4
|
import color from 'color';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useTheme","color","React","Animated","StyleSheet","Badge","children","style","visible","size","rest","opacity","useState","Value","rendered","setRendered","theme","useEffect","timing","toValue","duration","useNativeDriver","start","finished","stopAnimation","backgroundColor","colors","notification","restStyle","flatten","textColor","isLight","borderRadius","fontSize","Math","floor","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sources":["Badge.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport color from 'color';\nimport * as React from 'react';\nimport { Animated, StyleProp, StyleSheet, TextStyle } from 'react-native';\n\ntype Props = {\n /**\n * Whether the badge is visible\n */\n visible: boolean;\n /**\n * Content of the `Badge`.\n */\n children?: string | number;\n /**\n * Size of the `Badge`.\n */\n size?: number;\n /**\n * Style object for the tab bar container.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport default function Badge({\n children,\n style,\n visible = true,\n size = 18,\n ...rest\n}: Props) {\n const [opacity] = React.useState(() => new Animated.Value(visible ? 1 : 0));\n const [rendered, setRendered] = React.useState(visible);\n\n const theme = useTheme();\n\n React.useEffect(() => {\n if (!rendered) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue: visible ? 1 : 0,\n duration: 150,\n useNativeDriver: true,\n }).start(({ finished }) => {\n if (finished && !visible) {\n setRendered(false);\n }\n });\n\n return () => opacity.stopAnimation();\n }, [opacity, rendered, visible]);\n\n if (!rendered) {\n if (visible) {\n setRendered(true);\n } else {\n return null;\n }\n }\n\n // @ts-expect-error: backgroundColor definitely exists\n const { backgroundColor = theme.colors.notification, ...restStyle } =\n StyleSheet.flatten(style) || {};\n const textColor = color(backgroundColor).isLight() ? 'black' : 'white';\n\n const borderRadius = size / 2;\n const fontSize = Math.floor((size * 3) / 4);\n\n return (\n <Animated.Text\n numberOfLines={1}\n style={[\n {\n transform: [\n {\n scale: opacity.interpolate({\n inputRange: [0, 1],\n outputRange: [0.5, 1],\n }),\n },\n ],\n color: textColor,\n lineHeight: size - 1,\n height: size,\n minWidth: size,\n opacity,\n backgroundColor,\n fontSize,\n borderRadius,\n },\n styles.container,\n restStyle,\n ]}\n {...rest}\n >\n {children}\n </Animated.Text>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'flex-end',\n textAlign: 'center',\n paddingHorizontal: 4,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAA8BC,UAA9B,QAA2D,cAA3D;AAqBA,eAAe,SAASC,KAAT,OAML;EAAA,IANoB;IAC5BC,QAD4B;IAE5BC,KAF4B;IAG5BC,OAAO,GAAG,IAHkB;IAI5BC,IAAI,GAAG,EAJqB;IAK5B,GAAGC;EALyB,CAMpB;EACR,MAAM,CAACC,OAAD,IAAYT,KAAK,CAACU,QAAN,CAAe,MAAM,IAAIT,QAAQ,CAACU,KAAb,CAAmBL,OAAO,GAAG,CAAH,GAAO,CAAjC,CAArB,CAAlB;EACA,MAAM,CAACM,QAAD,EAAWC,WAAX,IAA0Bb,KAAK,CAACU,QAAN,CAAeJ,OAAf,CAAhC;EAEA,MAAMQ,KAAK,GAAGhB,QAAQ,EAAtB;EAEAE,KAAK,CAACe,SAAN,CAAgB,MAAM;IACpB,IAAI,CAACH,QAAL,EAAe;MACb;IACD;;IAEDX,QAAQ,CAACe,MAAT,CAAgBP,OAAhB,EAAyB;MACvBQ,OAAO,EAAEX,OAAO,GAAG,CAAH,GAAO,CADA;MAEvBY,QAAQ,EAAE,GAFa;MAGvBC,eAAe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cEc,eAdF;MAeEQ,QAfF;MAgBED;IAhBF,CADK,EAmBLY,MAAM,CAACC,SAnBF,EAoBLjB,SApBK;EAFT,GAwBMlB,IAxBN,GA0BGJ,QA1BH,CADF;AA8BD;AAED,MAAMsC,MAAM,GAAGxC,UAAU,CAAC0C,MAAX,CAAkB;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UADF;IAETC,SAAS,EAAE,QAFF;IAGTC,iBAAiB,EAAE,CAHV;IAITC,QAAQ,EAAE;EAJD;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomTabBar.tsx"],"names":["MissingIcon","CommonActions","NavigationContext","NavigationRouteContext","useLinkBuilder","useTheme","React","Animated","Platform","StyleSheet","View","useSafeAreaFrame","BottomTabBarHeightCallbackContext","useIsKeyboardShown","BottomTabItem","DEFAULT_TABBAR_HEIGHT","COMPACT_TABBAR_HEIGHT","DEFAULT_MAX_TAB_ITEM_WIDTH","useNativeDriver","OS","shouldUseHorizontalLabels","state","descriptors","layout","dimensions","tabBarLabelPosition","routes","index","key","options","width","maxTabWidth","reduce","acc","route","tabBarItemStyle","flattenedStyle","flatten","maxWidth","height","getPaddingBottom","insets","Math","max","bottom","select","ios","default","getTabBarHeight","style","rest","customHeight","isLandscape","horizontalLabels","paddingBottom","isPad","BottomTabBar","navigation","colors","buildLink","focusedRoute","focusedDescriptor","focusedOptions","tabBarShowLabel","tabBarHideOnKeyboard","tabBarVisibilityAnimationConfig","tabBarStyle","tabBarBackground","tabBarActiveTintColor","tabBarInactiveTintColor","tabBarActiveBackgroundColor","tabBarInactiveBackgroundColor","isKeyboardShown","onHeightChange","useContext","shouldShowTabBar","visibilityAnimationConfigRef","useRef","useEffect","current","isTabBarHidden","setIsTabBarHidden","useState","visible","Value","visibilityAnimationConfig","animation","show","spring","timing","toValue","duration","config","start","finished","hide","stopAnimation","setLayout","handleLayout","e","nativeEvent","tabBarHeight","hasHorizontalLabels","tabBarBackgroundElement","styles","tabBar","backgroundColor","card","borderTopColor","border","transform","translateY","interpolate","inputRange","outputRange","hairlineWidth","position","paddingHorizontal","left","right","absoluteFill","content","map","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","navigate","name","merge","onLongPress","label","tabBarLabel","undefined","title","accessibilityLabel","tabBarAccessibilityLabel","length","params","tabBarTestID","tabBarAllowFontScaling","tabBarButton","tabBarIcon","color","size","tabBarBadge","tabBarBadgeStyle","tabBarLabelStyle","tabBarIconStyle","create","borderTopWidth","elevation","flex","flexDirection"],"mappings":"AAAA,SAASA,WAAT,QAA4B,4BAA5B;AACA,SACEC,aADF,EAEEC,iBAFF,EAGEC,sBAHF,EAMEC,cANF,EAOEC,QAPF,QAQO,0BARP;AASA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SACEC,QADF,EAGEC,QAHF,EAKEC,UALF,EAMEC,IANF,QAQO,cARP;AASA,SAAqBC,gBAArB,QAA6C,gCAA7C;AAGA,OAAOC,iCAAP,MAA8C,4CAA9C;AACA,OAAOC,kBAAP,MAA+B,6BAA/B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AAMA,MAAMC,qBAAqB,GAAG,EAA9B;AACA,MAAMC,qBAAqB,GAAG,EAA9B;AACA,MAAMC,0BAA0B,GAAG,GAAnC;AAEA,MAAMC,eAAe,GAAGV,QAAQ,CAACW,EAAT,KAAgB,KAAxC;;AASA,MAAMC,yBAAyB,GAAG,QAKnB;AAAA,MALoB;AACjCC,IAAAA,KADiC;AAEjCC,IAAAA,WAFiC;AAGjCC,IAAAA,MAHiC;AAIjCC,IAAAA;AAJiC,GAKpB;AACb,QAAM;AAAEC,IAAAA;AAAF,MACJH,WAAW,CAACD,KAAK,CAACK,MAAN,CAAaL,KAAK,CAACM,KAAnB,EAA0BC,GAA3B,CAAX,CAA2CC,OAD7C;;AAGA,MAAIJ,mBAAJ,EAAyB;AACvB,YAAQA,mBAAR;AACE,WAAK,aAAL;AACE,eAAO,IAAP;;AAC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AAE,CAHF;AAIN+G,IAAAA,cAAc,EAAElJ,UAAU,CAAC0G,aAJrB;AAKNyC,IAAAA,SAAS,EAAE;AALL,GADuB;AAQ/BnC,EAAAA,OAAO,EAAE;AACPoC,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,aAAa,EAAE;AAFR;AARsB,CAAlB,CAAf","sourcesContent":["import { MissingIcon } from '@react-navigation/elements';\nimport {\n CommonActions,\n NavigationContext,\n NavigationRouteContext,\n ParamListBase,\n TabNavigationState,\n useLinkBuilder,\n useTheme,\n} from '@react-navigation/native';\nimport React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport { EdgeInsets, useSafeAreaFrame } from 'react-native-safe-area-context';\n\nimport type { BottomTabBarProps, BottomTabDescriptorMap } from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport useIsKeyboardShown from '../utils/useIsKeyboardShown';\nimport BottomTabItem from './BottomTabItem';\n\ntype Props = BottomTabBarProps & {\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n};\n\nconst DEFAULT_TABBAR_HEIGHT = 49;\nconst COMPACT_TABBAR_HEIGHT = 32;\nconst DEFAULT_MAX_TAB_ITEM_WIDTH = 125;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\ntype Options = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n layout: { height: number; width: number };\n dimensions: { height: number; width: number };\n};\n\nconst shouldUseHorizontalLabels = ({\n state,\n descriptors,\n layout,\n dimensions,\n}: Options) => {\n const { tabBarLabelPosition } =\n descriptors[state.routes[state.index].key].options;\n\n if (tabBarLabelPosition) {\n switch (tabBarLabelPosition) {\n case 'beside-icon':\n return true;\n case 'below-icon':\n return false;\n }\n }\n\n if (layout.width >= 768) {\n // Screen size matches a tablet\n const maxTabWidth = state.routes.reduce((acc, route) => {\n const { tabBarItemStyle } = descriptors[route.key].options;\n const flattenedStyle = StyleSheet.flatten(tabBarItemStyle);\n\n if (flattenedStyle) {\n if (typeof flattenedStyle.width === 'number') {\n return acc + flattenedStyle.width;\n } else if (typeof flattenedStyle.maxWidth === 'number') {\n return acc + flattenedStyle.maxWidth;\n }\n }\n\n return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;\n }, 0);\n\n return maxTabWidth <= layout.width;\n } else {\n return dimensions.width > dimensions.height;\n }\n};\n\nconst getPaddingBottom = (insets: EdgeInsets) =>\n Math.max(insets.bottom - Platform.select({ ios: 4, default: 0 }), 0);\n\nexport const getTabBarHeight = ({\n state,\n descriptors,\n dimensions,\n insets,\n style,\n ...rest\n}: Options & {\n insets: EdgeInsets;\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;\n}) => {\n // @ts-ignore\n const customHeight = StyleSheet.flatten(style)?.height;\n\n if (typeof customHeight === 'number') {\n return customHeight;\n }\n\n const isLandscape = dimensions.width > dimensions.height;\n const horizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n ...rest,\n });\n const paddingBottom = getPaddingBottom(insets);\n\n if (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n isLandscape &&\n horizontalLabels\n ) {\n return COMPACT_TABBAR_HEIGHT + paddingBottom;\n }\n\n return DEFAULT_TABBAR_HEIGHT + paddingBottom;\n};\n\nexport default function BottomTabBar({\n state,\n navigation,\n descriptors,\n insets,\n style,\n}: Props) {\n const { colors } = useTheme();\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const {\n tabBarShowLabel,\n tabBarHideOnKeyboard = false,\n tabBarVisibilityAnimationConfig,\n tabBarStyle,\n tabBarBackground,\n tabBarActiveTintColor,\n tabBarInactiveTintColor,\n tabBarActiveBackgroundColor,\n tabBarInactiveBackgroundColor,\n } = focusedOptions;\n\n const dimensions = useSafeAreaFrame();\n const isKeyboardShown = useIsKeyboardShown();\n\n const onHeightChange = React.useContext(BottomTabBarHeightCallbackContext);\n\n const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);\n\n const visibilityAnimationConfigRef = React.useRef(\n tabBarVisibilityAnimationConfig\n );\n\n React.useEffect(() => {\n visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;\n });\n\n const [isTabBarHidden, setIsTabBarHidden] = React.useState(!shouldShowTabBar);\n\n const [visible] = React.useState(\n () => new Animated.Value(shouldShowTabBar ? 1 : 0)\n );\n\n React.useEffect(() => {\n const visibilityAnimationConfig = visibilityAnimationConfigRef.current;\n\n if (shouldShowTabBar) {\n const animation =\n visibilityAnimationConfig?.show?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 1,\n useNativeDriver,\n duration: 250,\n ...visibilityAnimationConfig?.show?.config,\n }).start(({ finished }) => {\n if (finished) {\n setIsTabBarHidden(false);\n }\n });\n } else {\n setIsTabBarHidden(true);\n\n const animation =\n visibilityAnimationConfig?.hide?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 0,\n useNativeDriver,\n duration: 200,\n ...visibilityAnimationConfig?.hide?.config,\n }).start();\n }\n\n return () => visible.stopAnimation();\n }, [visible, shouldShowTabBar]);\n\n const [layout, setLayout] = React.useState({\n height: 0,\n width: dimensions.width,\n });\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n onHeightChange?.(height);\n\n setLayout((layout) => {\n if (height === layout.height && width === layout.width) {\n return layout;\n } else {\n return {\n height,\n width,\n };\n }\n });\n };\n\n const { routes } = state;\n\n const paddingBottom = getPaddingBottom(insets);\n const tabBarHeight = getTabBarHeight({\n state,\n descriptors,\n insets,\n dimensions,\n layout,\n style: [tabBarStyle, style],\n });\n\n const hasHorizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n layout,\n });\n\n const tabBarBackgroundElement = tabBarBackground?.();\n\n return (\n <Animated.View\n style={[\n styles.tabBar,\n {\n backgroundColor:\n tabBarBackgroundElement != null ? 'transparent' : colors.card,\n borderTopColor: colors.border,\n },\n {\n transform: [\n {\n translateY: visible.interpolate({\n inputRange: [0, 1],\n outputRange: [\n layout.height + paddingBottom + StyleSheet.hairlineWidth,\n 0,\n ],\n }),\n },\n ],\n // Absolutely position the tab bar so that the content is below it\n // This is needed to avoid gap at bottom when the tab bar is hidden\n position: isTabBarHidden ? 'absolute' : (null as any),\n },\n {\n height: tabBarHeight,\n paddingBottom,\n paddingHorizontal: Math.max(insets.left, insets.right),\n },\n tabBarStyle,\n ]}\n pointerEvents={isTabBarHidden ? 'none' : 'auto'}\n onLayout={handleLayout}\n >\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n {tabBarBackgroundElement}\n </View>\n <View accessibilityRole=\"tablist\" style={styles.content}>\n {routes.map((route, index) => {\n const focused = index === state.index;\n const { options } = descriptors[route.key];\n\n const onPress = () => {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (!focused && !event.defaultPrevented) {\n navigation.dispatch({\n ...CommonActions.navigate({ name: route.name, merge: true }),\n target: state.key,\n });\n }\n };\n\n const onLongPress = () => {\n navigation.emit({\n type: 'tabLongPress',\n target: route.key,\n });\n };\n\n const label =\n options.tabBarLabel !== undefined\n ? options.tabBarLabel\n : options.title !== undefined\n ? options.title\n : route.name;\n\n const accessibilityLabel =\n options.tabBarAccessibilityLabel !== undefined\n ? options.tabBarAccessibilityLabel\n : typeof label === 'string' && Platform.OS === 'ios'\n ? `${label}, tab, ${index + 1} of ${routes.length}`\n : undefined;\n\n return (\n <NavigationContext.Provider\n key={route.key}\n value={descriptors[route.key].navigation}\n >\n <NavigationRouteContext.Provider value={route}>\n <BottomTabItem\n route={route}\n focused={focused}\n horizontal={hasHorizontalLabels}\n onPress={onPress}\n onLongPress={onLongPress}\n accessibilityLabel={accessibilityLabel}\n to={buildLink(route.name, route.params)}\n testID={options.tabBarTestID}\n allowFontScaling={options.tabBarAllowFontScaling}\n activeTintColor={tabBarActiveTintColor}\n inactiveTintColor={tabBarInactiveTintColor}\n activeBackgroundColor={tabBarActiveBackgroundColor}\n inactiveBackgroundColor={tabBarInactiveBackgroundColor}\n button={options.tabBarButton}\n icon={\n options.tabBarIcon ??\n (({ color, size }) => (\n <MissingIcon color={color} size={size} />\n ))\n }\n badge={options.tabBarBadge}\n badgeStyle={options.tabBarBadgeStyle}\n label={label}\n showLabel={tabBarShowLabel}\n labelStyle={options.tabBarLabelStyle}\n iconStyle={options.tabBarIconStyle}\n style={options.tabBarItemStyle}\n />\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n );\n })}\n </View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n tabBar: {\n left: 0,\n right: 0,\n bottom: 0,\n borderTopWidth: StyleSheet.hairlineWidth,\n elevation: 8,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["MissingIcon","CommonActions","NavigationContext","NavigationRouteContext","useLinkBuilder","useTheme","React","Animated","Platform","StyleSheet","View","useSafeAreaFrame","BottomTabBarHeightCallbackContext","useIsKeyboardShown","BottomTabItem","DEFAULT_TABBAR_HEIGHT","COMPACT_TABBAR_HEIGHT","DEFAULT_MAX_TAB_ITEM_WIDTH","useNativeDriver","OS","shouldUseHorizontalLabels","state","descriptors","layout","dimensions","tabBarLabelPosition","routes","index","key","options","width","maxTabWidth","reduce","acc","route","tabBarItemStyle","flattenedStyle","flatten","maxWidth","height","getPaddingBottom","insets","Math","max","bottom","select","ios","default","getTabBarHeight","style","rest","customHeight","isLandscape","horizontalLabels","paddingBottom","isPad","BottomTabBar","navigation","colors","buildLink","focusedRoute","focusedDescriptor","focusedOptions","tabBarShowLabel","tabBarHideOnKeyboard","tabBarVisibilityAnimationConfig","tabBarStyle","tabBarBackground","tabBarActiveTintColor","tabBarInactiveTintColor","tabBarActiveBackgroundColor","tabBarInactiveBackgroundColor","isKeyboardShown","onHeightChange","useContext","shouldShowTabBar","visibilityAnimationConfigRef","useRef","useEffect","current","isTabBarHidden","setIsTabBarHidden","useState","visible","Value","visibilityAnimationConfig","animation","show","spring","timing","toValue","duration","config","start","finished","hide","stopAnimation","setLayout","handleLayout","e","nativeEvent","tabBarHeight","hasHorizontalLabels","tabBarBackgroundElement","styles","tabBar","backgroundColor","card","borderTopColor","border","transform","translateY","interpolate","inputRange","outputRange","hairlineWidth","position","paddingHorizontal","left","right","absoluteFill","content","map","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","navigate","name","merge","onLongPress","label","tabBarLabel","undefined","title","accessibilityLabel","tabBarAccessibilityLabel","length","params","tabBarTestID","tabBarAllowFontScaling","tabBarButton","tabBarIcon","color","size","tabBarBadge","tabBarBadgeStyle","tabBarLabelStyle","tabBarIconStyle","create","borderTopWidth","elevation","flex","flexDirection"],"sources":["BottomTabBar.tsx"],"sourcesContent":["import { MissingIcon } from '@react-navigation/elements';\nimport {\n CommonActions,\n NavigationContext,\n NavigationRouteContext,\n ParamListBase,\n TabNavigationState,\n useLinkBuilder,\n useTheme,\n} from '@react-navigation/native';\nimport React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport { EdgeInsets, useSafeAreaFrame } from 'react-native-safe-area-context';\n\nimport type { BottomTabBarProps, BottomTabDescriptorMap } from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport useIsKeyboardShown from '../utils/useIsKeyboardShown';\nimport BottomTabItem from './BottomTabItem';\n\ntype Props = BottomTabBarProps & {\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n};\n\nconst DEFAULT_TABBAR_HEIGHT = 49;\nconst COMPACT_TABBAR_HEIGHT = 32;\nconst DEFAULT_MAX_TAB_ITEM_WIDTH = 125;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\ntype Options = {\n state: TabNavigationState<ParamListBase>;\n descriptors: BottomTabDescriptorMap;\n layout: { height: number; width: number };\n dimensions: { height: number; width: number };\n};\n\nconst shouldUseHorizontalLabels = ({\n state,\n descriptors,\n layout,\n dimensions,\n}: Options) => {\n const { tabBarLabelPosition } =\n descriptors[state.routes[state.index].key].options;\n\n if (tabBarLabelPosition) {\n switch (tabBarLabelPosition) {\n case 'beside-icon':\n return true;\n case 'below-icon':\n return false;\n }\n }\n\n if (layout.width >= 768) {\n // Screen size matches a tablet\n const maxTabWidth = state.routes.reduce((acc, route) => {\n const { tabBarItemStyle } = descriptors[route.key].options;\n const flattenedStyle = StyleSheet.flatten(tabBarItemStyle);\n\n if (flattenedStyle) {\n if (typeof flattenedStyle.width === 'number') {\n return acc + flattenedStyle.width;\n } else if (typeof flattenedStyle.maxWidth === 'number') {\n return acc + flattenedStyle.maxWidth;\n }\n }\n\n return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;\n }, 0);\n\n return maxTabWidth <= layout.width;\n } else {\n return dimensions.width > dimensions.height;\n }\n};\n\nconst getPaddingBottom = (insets: EdgeInsets) =>\n Math.max(insets.bottom - Platform.select({ ios: 4, default: 0 }), 0);\n\nexport const getTabBarHeight = ({\n state,\n descriptors,\n dimensions,\n insets,\n style,\n ...rest\n}: Options & {\n insets: EdgeInsets;\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>> | undefined;\n}) => {\n // @ts-ignore\n const customHeight = StyleSheet.flatten(style)?.height;\n\n if (typeof customHeight === 'number') {\n return customHeight;\n }\n\n const isLandscape = dimensions.width > dimensions.height;\n const horizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n ...rest,\n });\n const paddingBottom = getPaddingBottom(insets);\n\n if (\n Platform.OS === 'ios' &&\n !Platform.isPad &&\n isLandscape &&\n horizontalLabels\n ) {\n return COMPACT_TABBAR_HEIGHT + paddingBottom;\n }\n\n return DEFAULT_TABBAR_HEIGHT + paddingBottom;\n};\n\nexport default function BottomTabBar({\n state,\n navigation,\n descriptors,\n insets,\n style,\n}: Props) {\n const { colors } = useTheme();\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const {\n tabBarShowLabel,\n tabBarHideOnKeyboard = false,\n tabBarVisibilityAnimationConfig,\n tabBarStyle,\n tabBarBackground,\n tabBarActiveTintColor,\n tabBarInactiveTintColor,\n tabBarActiveBackgroundColor,\n tabBarInactiveBackgroundColor,\n } = focusedOptions;\n\n const dimensions = useSafeAreaFrame();\n const isKeyboardShown = useIsKeyboardShown();\n\n const onHeightChange = React.useContext(BottomTabBarHeightCallbackContext);\n\n const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);\n\n const visibilityAnimationConfigRef = React.useRef(\n tabBarVisibilityAnimationConfig\n );\n\n React.useEffect(() => {\n visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;\n });\n\n const [isTabBarHidden, setIsTabBarHidden] = React.useState(!shouldShowTabBar);\n\n const [visible] = React.useState(\n () => new Animated.Value(shouldShowTabBar ? 1 : 0)\n );\n\n React.useEffect(() => {\n const visibilityAnimationConfig = visibilityAnimationConfigRef.current;\n\n if (shouldShowTabBar) {\n const animation =\n visibilityAnimationConfig?.show?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 1,\n useNativeDriver,\n duration: 250,\n ...visibilityAnimationConfig?.show?.config,\n }).start(({ finished }) => {\n if (finished) {\n setIsTabBarHidden(false);\n }\n });\n } else {\n setIsTabBarHidden(true);\n\n const animation =\n visibilityAnimationConfig?.hide?.animation === 'spring'\n ? Animated.spring\n : Animated.timing;\n\n animation(visible, {\n toValue: 0,\n useNativeDriver,\n duration: 200,\n ...visibilityAnimationConfig?.hide?.config,\n }).start();\n }\n\n return () => visible.stopAnimation();\n }, [visible, shouldShowTabBar]);\n\n const [layout, setLayout] = React.useState({\n height: 0,\n width: dimensions.width,\n });\n\n const handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n onHeightChange?.(height);\n\n setLayout((layout) => {\n if (height === layout.height && width === layout.width) {\n return layout;\n } else {\n return {\n height,\n width,\n };\n }\n });\n };\n\n const { routes } = state;\n\n const paddingBottom = getPaddingBottom(insets);\n const tabBarHeight = getTabBarHeight({\n state,\n descriptors,\n insets,\n dimensions,\n layout,\n style: [tabBarStyle, style],\n });\n\n const hasHorizontalLabels = shouldUseHorizontalLabels({\n state,\n descriptors,\n dimensions,\n layout,\n });\n\n const tabBarBackgroundElement = tabBarBackground?.();\n\n return (\n <Animated.View\n style={[\n styles.tabBar,\n {\n backgroundColor:\n tabBarBackgroundElement != null ? 'transparent' : colors.card,\n borderTopColor: colors.border,\n },\n {\n transform: [\n {\n translateY: visible.interpolate({\n inputRange: [0, 1],\n outputRange: [\n layout.height + paddingBottom + StyleSheet.hairlineWidth,\n 0,\n ],\n }),\n },\n ],\n // Absolutely position the tab bar so that the content is below it\n // This is needed to avoid gap at bottom when the tab bar is hidden\n position: isTabBarHidden ? 'absolute' : (null as any),\n },\n {\n height: tabBarHeight,\n paddingBottom,\n paddingHorizontal: Math.max(insets.left, insets.right),\n },\n tabBarStyle,\n ]}\n pointerEvents={isTabBarHidden ? 'none' : 'auto'}\n onLayout={handleLayout}\n >\n <View pointerEvents=\"none\" style={StyleSheet.absoluteFill}>\n {tabBarBackgroundElement}\n </View>\n <View accessibilityRole=\"tablist\" style={styles.content}>\n {routes.map((route, index) => {\n const focused = index === state.index;\n const { options } = descriptors[route.key];\n\n const onPress = () => {\n const event = navigation.emit({\n type: 'tabPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (!focused && !event.defaultPrevented) {\n navigation.dispatch({\n ...CommonActions.navigate({ name: route.name, merge: true }),\n target: state.key,\n });\n }\n };\n\n const onLongPress = () => {\n navigation.emit({\n type: 'tabLongPress',\n target: route.key,\n });\n };\n\n const label =\n options.tabBarLabel !== undefined\n ? options.tabBarLabel\n : options.title !== undefined\n ? options.title\n : route.name;\n\n const accessibilityLabel =\n options.tabBarAccessibilityLabel !== undefined\n ? options.tabBarAccessibilityLabel\n : typeof label === 'string' && Platform.OS === 'ios'\n ? `${label}, tab, ${index + 1} of ${routes.length}`\n : undefined;\n\n return (\n <NavigationContext.Provider\n key={route.key}\n value={descriptors[route.key].navigation}\n >\n <NavigationRouteContext.Provider value={route}>\n <BottomTabItem\n route={route}\n focused={focused}\n horizontal={hasHorizontalLabels}\n onPress={onPress}\n onLongPress={onLongPress}\n accessibilityLabel={accessibilityLabel}\n to={buildLink(route.name, route.params)}\n testID={options.tabBarTestID}\n allowFontScaling={options.tabBarAllowFontScaling}\n activeTintColor={tabBarActiveTintColor}\n inactiveTintColor={tabBarInactiveTintColor}\n activeBackgroundColor={tabBarActiveBackgroundColor}\n inactiveBackgroundColor={tabBarInactiveBackgroundColor}\n button={options.tabBarButton}\n icon={\n options.tabBarIcon ??\n (({ color, size }) => (\n <MissingIcon color={color} size={size} />\n ))\n }\n badge={options.tabBarBadge}\n badgeStyle={options.tabBarBadgeStyle}\n label={label}\n showLabel={tabBarShowLabel}\n labelStyle={options.tabBarLabelStyle}\n iconStyle={options.tabBarIconStyle}\n style={options.tabBarItemStyle}\n />\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n );\n })}\n </View>\n </Animated.View>\n );\n}\n\nconst styles = StyleSheet.create({\n tabBar: {\n left: 0,\n right: 0,\n bottom: 0,\n borderTopWidth: StyleSheet.hairlineWidth,\n elevation: 8,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n },\n});\n"],"mappings":"AAAA,SAASA,WAAT,QAA4B,4BAA5B;AACA,SACEC,aADF,EAEEC,iBAFF,EAGEC,sBAHF,EAMEC,cANF,EAOEC,QAPF,QAQO,0BARP;AASA,OAAOC,KAAP,MAAkB,OAAlB;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IAEPC,aAAa,EAAE;EAFR;AARsB,CAAlB,CAAf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import { Link, useTheme } from '@react-navigation/native';
|
|
4
4
|
import Color from 'color';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomTabItem.tsx"],"names":["Link","useTheme","Color","React","Platform","Pressable","StyleSheet","Text","TabBarIcon","BottomTabBarItem","focused","route","label","icon","badge","badgeStyle","to","button","children","style","onPress","accessibilityRole","rest","OS","styles","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","accessibilityLabel","testID","onLongPress","horizontal","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","labelStyle","iconStyle","colors","undefined","primary","text","mix","card","hex","renderLabel","color","labelBeside","labelBeneath","position","renderIcon","activeOpacity","inactiveOpacity","scene","backgroundColor","select","ios","default","accessibilityState","selected","accessibilityStates","tab","tabLandscape","tabPortrait","create","flex","alignItems","justifyContent","flexDirection","textAlign","fontSize","marginLeft","marginTop","display"],"mappings":";;AAAA,SAASA,IAAT,EAAsBC,QAAtB,QAAsC,0BAAtC;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAEEC,QAFF,EAGEC,SAHF,EAKEC,UALF,EAMEC,IANF,QASO,cATP;AAYA,OAAOC,UAAP,MAAuB,cAAvB;AA0GA,eAAe,SAASC,gBAAT,OAgEL;AAAA,MAhE+B;AACvCC,IAAAA,OADuC;AAEvCC,IAAAA,KAFuC;AAGvCC,IAAAA,KAHuC;AAIv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D,IAAAA,mBAAmB,EAAEzD,OAAO,GAAG,CAAC,UAAD,CAAH,GAAkB,EAVlC;AAWZS,IAAAA,KAAK,EAAE,CACLK,MAAM,CAAC4C,GADF,EAEL;AAAEP,MAAAA;AAAF,KAFK,EAGL3B,UAAU,GAAGV,MAAM,CAAC6C,YAAV,GAAyB7C,MAAM,CAAC8C,WAHrC,EAILnD,KAJK,CAXK;AAiBZD,IAAAA,QAAQ,eACN,oBAAC,KAAD,CAAO,QAAP,QACGuC,UAAU,CAACG,KAAD,CADb,EAEGR,WAAW,CAACQ,KAAD,CAFd;AAlBU,GAAD,CAAb;AAwBD;AAED,MAAMpC,MAAM,GAAGlB,UAAU,CAACiE,MAAX,CAAkB;AAC/BH,EAAAA,GAAG,EAAE;AACHI,IAAAA,IAAI,EAAE,CADH;AAEHC,IAAAA,UAAU,EAAE;AAFT,GAD0B;AAK/BH,EAAAA,WAAW,EAAE;AACXI,IAAAA,cAAc,EAAE,UADL;AAEXC,IAAAA,aAAa,EAAE;AAFJ,GALkB;AAS/BN,EAAAA,YAAY,EAAE;AACZK,IAAAA,cAAc,EAAE,QADJ;AAEZC,IAAAA,aAAa,EAAE;AAFH,GATiB;AAa/B/D,EAAAA,KAAK,EAAE;AACLgE,IAAAA,SAAS,EAAE,QADN;AAELf,IAAAA,eAAe,EAAE;AAFZ,GAbwB;AAiB/BN,EAAAA,YAAY,EAAE;AACZsB,IAAAA,QAAQ,EAAE;AADE,GAjBiB;AAoB/BvB,EAAAA,WAAW,EAAE;AACXuB,IAAAA,QAAQ,EAAE,EADC;AAEXC,IAAAA,UAAU,EAAE,EAFD;AAGXC,IAAAA,SAAS,EAAE;AAHA,GApBkB;AAyB/B9D,EAAAA,MAAM,EAAE;AACN+D,IAAAA,OAAO,EAAE;AADH;AAzBuB,CAAlB,CAAf","sourcesContent":["import { Link, Route, useTheme } from '@react-navigation/native';\nimport Color from 'color';\nimport React from 'react';\nimport {\n GestureResponderEvent,\n Platform,\n Pressable,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nimport type { BottomTabBarButtonProps, LabelPosition } from '../types';\nimport TabBarIcon from './TabBarIcon';\n\ntype Props = {\n /**\n * Whether the tab is focused.\n */\n focused: boolean;\n /**\n * The route object which should be specified by the tab.\n */\n route: Route<string>;\n /**\n * The label text of the tab.\n */\n label:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n /**\n * Icon to display for the tab.\n */\n icon: (props: {\n focused: boolean;\n size: number;\n color: string;\n }) => React.ReactNode;\n /**\n * Text to show in a badge on the tab icon.\n */\n badge?: number | string;\n /**\n * Custom style for the badge.\n */\n badgeStyle?: StyleProp<TextStyle>;\n /**\n * URL to use for the link to the tab.\n */\n to?: string;\n /**\n * The button for the tab. Uses a `TouchableWithoutFeedback` by default.\n */\n button?: (props: BottomTabBarButtonProps) => React.ReactNode;\n /**\n * The accessibility label for the tab.\n */\n accessibilityLabel?: string;\n /**\n * An unique ID for testing for the tab.\n */\n testID?: string;\n /**\n * Function to execute on press in React Native.\n * On the web, this will use onClick.\n */\n onPress: (\n e: React.MouseEvent<HTMLElement, MouseEvent> | GestureResponderEvent\n ) => void;\n /**\n * Function to execute on long press.\n */\n onLongPress: (e: GestureResponderEvent) => void;\n /**\n * Whether the label should be aligned with the icon horizontally.\n */\n horizontal: boolean;\n /**\n * Color for the icon and label when the item is active.\n */\n activeTintColor?: string;\n /**\n * Color for the icon and label when the item is inactive.\n */\n inactiveTintColor?: string;\n /**\n * Background color for item when its active.\n */\n activeBackgroundColor?: string;\n /**\n * Background color for item when its inactive.\n */\n inactiveBackgroundColor?: string;\n /**\n * Whether to show the label text for the tab.\n */\n showLabel?: boolean;\n /**\n * Whether to allow scaling the font for the label for accessibility purposes.\n */\n allowFontScaling?: boolean;\n /**\n * Style object for the label element.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * Style object for the icon element.\n */\n iconStyle?: StyleProp<ViewStyle>;\n /**\n * Style object for the wrapper element.\n */\n style?: StyleProp<ViewStyle>;\n};\n\nexport default function BottomTabBarItem({\n focused,\n route,\n label,\n icon,\n badge,\n badgeStyle,\n to,\n button = ({\n children,\n style,\n onPress,\n to,\n accessibilityRole,\n ...rest\n }: BottomTabBarButtonProps) => {\n if (Platform.OS === 'web' && to) {\n // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.\n // We need to use `onClick` to be able to prevent default browser handling of links.\n return (\n <Link\n {...rest}\n to={to}\n style={[styles.button, style]}\n onPress={(e: any) => {\n if (\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n (e.button == null || e.button === 0) // ignore everything but left clicks\n ) {\n e.preventDefault();\n onPress?.(e);\n }\n }}\n >\n {children}\n </Link>\n );\n } else {\n return (\n <Pressable\n {...rest}\n accessibilityRole={accessibilityRole}\n onPress={onPress}\n style={style}\n >\n {children}\n </Pressable>\n );\n }\n },\n accessibilityLabel,\n testID,\n onPress,\n onLongPress,\n horizontal,\n activeTintColor: customActiveTintColor,\n inactiveTintColor: customInactiveTintColor,\n activeBackgroundColor = 'transparent',\n inactiveBackgroundColor = 'transparent',\n showLabel = true,\n allowFontScaling,\n labelStyle,\n iconStyle,\n style,\n}: Props) {\n const { colors } = useTheme();\n\n const activeTintColor =\n customActiveTintColor === undefined\n ? colors.primary\n : customActiveTintColor;\n\n const inactiveTintColor =\n customInactiveTintColor === undefined\n ? Color(colors.text).mix(Color(colors.card), 0.5).hex()\n : customInactiveTintColor;\n\n const renderLabel = ({ focused }: { focused: boolean }) => {\n if (showLabel === false) {\n return null;\n }\n\n const color = focused ? activeTintColor : inactiveTintColor;\n\n if (typeof label === 'string') {\n return (\n <Text\n numberOfLines={1}\n style={[\n styles.label,\n { color },\n horizontal ? styles.labelBeside : styles.labelBeneath,\n labelStyle,\n ]}\n allowFontScaling={allowFontScaling}\n >\n {label}\n </Text>\n );\n }\n\n return label({\n focused,\n color,\n position: horizontal ? 'beside-icon' : 'below-icon',\n });\n };\n\n const renderIcon = ({ focused }: { focused: boolean }) => {\n if (icon === undefined) {\n return null;\n }\n\n const activeOpacity = focused ? 1 : 0;\n const inactiveOpacity = focused ? 0 : 1;\n\n return (\n <TabBarIcon\n route={route}\n horizontal={horizontal}\n badge={badge}\n badgeStyle={badgeStyle}\n activeOpacity={activeOpacity}\n inactiveOpacity={inactiveOpacity}\n activeTintColor={activeTintColor}\n inactiveTintColor={inactiveTintColor}\n renderIcon={icon}\n style={iconStyle}\n />\n );\n };\n\n const scene = { route, focused };\n\n const backgroundColor = focused\n ? activeBackgroundColor\n : inactiveBackgroundColor;\n\n return button({\n to,\n onPress,\n onLongPress,\n testID,\n accessibilityLabel,\n // FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS\n accessibilityRole: Platform.select({ ios: 'button', default: 'tab' }),\n accessibilityState: { selected: focused },\n // @ts-expect-error: keep for compatibility with older React Native versions\n accessibilityStates: focused ? ['selected'] : [],\n style: [\n styles.tab,\n { backgroundColor },\n horizontal ? styles.tabLandscape : styles.tabPortrait,\n style,\n ],\n children: (\n <React.Fragment>\n {renderIcon(scene)}\n {renderLabel(scene)}\n </React.Fragment>\n ),\n }) as React.ReactElement;\n}\n\nconst styles = StyleSheet.create({\n tab: {\n flex: 1,\n alignItems: 'center',\n },\n tabPortrait: {\n justifyContent: 'flex-end',\n flexDirection: 'column',\n },\n tabLandscape: {\n justifyContent: 'center',\n flexDirection: 'row',\n },\n label: {\n textAlign: 'center',\n backgroundColor: 'transparent',\n },\n labelBeneath: {\n fontSize: 10,\n },\n labelBeside: {\n fontSize: 13,\n marginLeft: 20,\n marginTop: 3,\n },\n button: {\n display: 'flex',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["Link","useTheme","Color","React","Platform","Pressable","StyleSheet","Text","TabBarIcon","BottomTabBarItem","focused","route","label","icon","badge","badgeStyle","to","button","children","style","onPress","accessibilityRole","rest","OS","styles","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","accessibilityLabel","testID","onLongPress","horizontal","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","labelStyle","iconStyle","colors","undefined","primary","text","mix","card","hex","renderLabel","color","labelBeside","labelBeneath","position","renderIcon","activeOpacity","inactiveOpacity","scene","backgroundColor","select","ios","default","accessibilityState","selected","accessibilityStates","tab","tabLandscape","tabPortrait","create","flex","alignItems","justifyContent","flexDirection","textAlign","fontSize","marginLeft","marginTop","display"],"sources":["BottomTabItem.tsx"],"sourcesContent":["import { Link, Route, useTheme } from '@react-navigation/native';\nimport Color from 'color';\nimport React from 'react';\nimport {\n GestureResponderEvent,\n Platform,\n Pressable,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nimport type { BottomTabBarButtonProps, LabelPosition } from '../types';\nimport TabBarIcon from './TabBarIcon';\n\ntype Props = {\n /**\n * Whether the tab is focused.\n */\n focused: boolean;\n /**\n * The route object which should be specified by the tab.\n */\n route: Route<string>;\n /**\n * The label text of the tab.\n */\n label:\n | string\n | ((props: {\n focused: boolean;\n color: string;\n position: LabelPosition;\n }) => React.ReactNode);\n /**\n * Icon to display for the tab.\n */\n icon: (props: {\n focused: boolean;\n size: number;\n color: string;\n }) => React.ReactNode;\n /**\n * Text to show in a badge on the tab icon.\n */\n badge?: number | string;\n /**\n * Custom style for the badge.\n */\n badgeStyle?: StyleProp<TextStyle>;\n /**\n * URL to use for the link to the tab.\n */\n to?: string;\n /**\n * The button for the tab. Uses a `TouchableWithoutFeedback` by default.\n */\n button?: (props: BottomTabBarButtonProps) => React.ReactNode;\n /**\n * The accessibility label for the tab.\n */\n accessibilityLabel?: string;\n /**\n * An unique ID for testing for the tab.\n */\n testID?: string;\n /**\n * Function to execute on press in React Native.\n * On the web, this will use onClick.\n */\n onPress: (\n e: React.MouseEvent<HTMLElement, MouseEvent> | GestureResponderEvent\n ) => void;\n /**\n * Function to execute on long press.\n */\n onLongPress: (e: GestureResponderEvent) => void;\n /**\n * Whether the label should be aligned with the icon horizontally.\n */\n horizontal: boolean;\n /**\n * Color for the icon and label when the item is active.\n */\n activeTintColor?: string;\n /**\n * Color for the icon and label when the item is inactive.\n */\n inactiveTintColor?: string;\n /**\n * Background color for item when its active.\n */\n activeBackgroundColor?: string;\n /**\n * Background color for item when its inactive.\n */\n inactiveBackgroundColor?: string;\n /**\n * Whether to show the label text for the tab.\n */\n showLabel?: boolean;\n /**\n * Whether to allow scaling the font for the label for accessibility purposes.\n */\n allowFontScaling?: boolean;\n /**\n * Style object for the label element.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * Style object for the icon element.\n */\n iconStyle?: StyleProp<ViewStyle>;\n /**\n * Style object for the wrapper element.\n */\n style?: StyleProp<ViewStyle>;\n};\n\nexport default function BottomTabBarItem({\n focused,\n route,\n label,\n icon,\n badge,\n badgeStyle,\n to,\n button = ({\n children,\n style,\n onPress,\n to,\n accessibilityRole,\n ...rest\n }: BottomTabBarButtonProps) => {\n if (Platform.OS === 'web' && to) {\n // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.\n // We need to use `onClick` to be able to prevent default browser handling of links.\n return (\n <Link\n {...rest}\n to={to}\n style={[styles.button, style]}\n onPress={(e: any) => {\n if (\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n (e.button == null || e.button === 0) // ignore everything but left clicks\n ) {\n e.preventDefault();\n onPress?.(e);\n }\n }}\n >\n {children}\n </Link>\n );\n } else {\n return (\n <Pressable\n {...rest}\n accessibilityRole={accessibilityRole}\n onPress={onPress}\n style={style}\n >\n {children}\n </Pressable>\n );\n }\n },\n accessibilityLabel,\n testID,\n onPress,\n onLongPress,\n horizontal,\n activeTintColor: customActiveTintColor,\n inactiveTintColor: customInactiveTintColor,\n activeBackgroundColor = 'transparent',\n inactiveBackgroundColor = 'transparent',\n showLabel = true,\n allowFontScaling,\n labelStyle,\n iconStyle,\n style,\n}: Props) {\n const { colors } = useTheme();\n\n const activeTintColor =\n customActiveTintColor === undefined\n ? colors.primary\n : customActiveTintColor;\n\n const inactiveTintColor =\n customInactiveTintColor === undefined\n ? Color(colors.text).mix(Color(colors.card), 0.5).hex()\n : customInactiveTintColor;\n\n const renderLabel = ({ focused }: { focused: boolean }) => {\n if (showLabel === false) {\n return null;\n }\n\n const color = focused ? activeTintColor : inactiveTintColor;\n\n if (typeof label === 'string') {\n return (\n <Text\n numberOfLines={1}\n style={[\n styles.label,\n { color },\n horizontal ? styles.labelBeside : styles.labelBeneath,\n labelStyle,\n ]}\n allowFontScaling={allowFontScaling}\n >\n {label}\n </Text>\n );\n }\n\n return label({\n focused,\n color,\n position: horizontal ? 'beside-icon' : 'below-icon',\n });\n };\n\n const renderIcon = ({ focused }: { focused: boolean }) => {\n if (icon === undefined) {\n return null;\n }\n\n const activeOpacity = focused ? 1 : 0;\n const inactiveOpacity = focused ? 0 : 1;\n\n return (\n <TabBarIcon\n route={route}\n horizontal={horizontal}\n badge={badge}\n badgeStyle={badgeStyle}\n activeOpacity={activeOpacity}\n inactiveOpacity={inactiveOpacity}\n activeTintColor={activeTintColor}\n inactiveTintColor={inactiveTintColor}\n renderIcon={icon}\n style={iconStyle}\n />\n );\n };\n\n const scene = { route, focused };\n\n const backgroundColor = focused\n ? activeBackgroundColor\n : inactiveBackgroundColor;\n\n return button({\n to,\n onPress,\n onLongPress,\n testID,\n accessibilityLabel,\n // FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS\n accessibilityRole: Platform.select({ ios: 'button', default: 'tab' }),\n accessibilityState: { selected: focused },\n // @ts-expect-error: keep for compatibility with older React Native versions\n accessibilityStates: focused ? ['selected'] : [],\n style: [\n styles.tab,\n { backgroundColor },\n horizontal ? styles.tabLandscape : styles.tabPortrait,\n style,\n ],\n children: (\n <React.Fragment>\n {renderIcon(scene)}\n {renderLabel(scene)}\n </React.Fragment>\n ),\n }) as React.ReactElement;\n}\n\nconst styles = StyleSheet.create({\n tab: {\n flex: 1,\n alignItems: 'center',\n },\n tabPortrait: {\n justifyContent: 'flex-end',\n flexDirection: 'column',\n },\n tabLandscape: {\n justifyContent: 'center',\n flexDirection: 'row',\n },\n label: {\n textAlign: 'center',\n backgroundColor: 'transparent',\n },\n labelBeneath: {\n fontSize: 10,\n },\n labelBeside: {\n fontSize: 13,\n marginLeft: 20,\n marginTop: 3,\n },\n button: {\n display: 'flex',\n },\n});\n"],"mappings":";;AAAA,SAASA,IAAT,EAAsBC,QAAtB,QAAsC,0BAAtC;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAEEC,QAFF,EAGEC,SAHF,EAKEC,UALF,EAMEC,IANF,QASO,cATP;AAYA,OAAOC,UAAP,MAAuB,cAAvB;AA0GA,eAAe,SAASC,gBAAT,OAgEL;EAAA,IAhE+B;IACvCC,OADuC;IAEvCC,KAFuC;IAGvCC,KAHuC;IAIvCC,IAJuC;IAKvCC,KALuC;IAMvCC,UANuC;IAOvCC,EAPuC;IAQvCC,MAAM,GAAG,SAOsB;MAAA,IAPrB;QACRC,QADQ;QAERC,KAFQ;QAGRC,OAHQ;QAIRJ,EAJQ;QAKRK,iBALQ;QAMR,GAAGC;MANK,CAOqB;;MAC7B,IAAIlB,QAAQ,CAACmB,EAAT,KAAgB,KAAhB,IAAyBP,EAA7B,EAAiC;QAC/B;QACA;QACA,oBACE,oBAAC,IAAD,eACMM,IADN;UAEE,EAAE,EAAEN,EAFN;UAGE,KAAK,EAAE,CAACQ,MAAM,CAACP,MAAR,EAAgBE,KAAhB,CAHT;UAIE,OAAO,EAAGM,CAAD,IAAY;YACnB,IACE,EAAEA,CAAC,CAACC,OAAF,IAAaD,CAAC,CAACE,MAAf,IAAyBF,CAAC,CAACG,OAA3B,IAAsCH,CAAC,CAACI,QAA1C,OAAuD;YACtDJ,CAAC,CAACR,MAAF,IAAY,IAAZ,IAAoBQ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() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import { getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomTabView.tsx"],"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","React","Platform","StyleSheet","SafeAreaInsetsContext","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","BottomTabBar","getTabBarHeight","MaybeScreen","MaybeScreenContainer","BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","useState","includes","dimensions","initialMetrics","frame","tabBarHeight","setTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","name","headerShown","headerStatusBarHeight","headerTransparent","absoluteFill","zIndex","render","create","flex","overflow"],"mappings":";;AAAA,SACEA,cADF,EAEEC,MAFF,EAGEC,sBAHF,EAIEC,MAJF,QAKO,4BALP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,cAArC;AACA,SAASC,qBAAT,QAAsC,gCAAtC;AAUA,OAAOC,iCAAP,MAA8C,4CAA9C;AACA,OAAOC,yBAAP,MAAsC,oCAAtC;AACA,OAAOC,YAAP,IAAuBC,eAAvB,QAA8C,gBAA9C;AACA,SAASC,WAAT,EAAsBC,oBAAtB,QAAkD,kBAAlD;AAQA,eAAe,SAASC,aAAT,CAAuBC,KAAvB,EAAqC;AAClD,QAAM;AACJC,IAAAA,MAAM,GAAID,KAAD,iBAA8B,oBAAC,YAAD,EAAkBA,K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AACnC,UAHzB;AAIE,MAAA,WAAW,EAAE0C,WAJf;AAKE,MAAA,qBAAqB,EAAEC,qBALzB;AAME,MAAA,iBAAiB,EAAEC,iBANrB;AAOE,MAAA,MAAM,EAAEJ,MAAM,CAAC;AACbrB,QAAAA,MAAM,EAAEL,UADK;AAEboB,QAAAA,KAAK,EAAEC,UAAU,CAACD,KAFL;AAGblC,QAAAA,UAAU,EACRmC,UAAU,CAACnC,UAJA;AAKbwB,QAAAA,OAAO,EAAEW,UAAU,CAACX;AALP,OAAD,CAPhB;AAcE,MAAA,KAAK,EAAEnB;AAdT,OAgBG8B,UAAU,CAACY,MAAX,EAhBH,CADF,CAPF,CADF;AA8BD,GA1DA,CALH,CADF,eAkEE,oBAAC,iCAAD,CAAmC,QAAnC;AAA4C,IAAA,KAAK,EAAE7B;AAAnD,KACGQ,YAAY,EADf,CAlEF,CADF;AAwED;AAED,MAAMK,MAAM,GAAG3C,UAAU,CAAC4D,MAAX,CAAkB;AAC/BhB,EAAAA,SAAS,EAAE;AACTiB,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,QAAQ,EAAE;AAFD;AADoB,CAAlB,CAAf","sourcesContent":["import {\n getHeaderTitle,\n Header,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n TabNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform, StyleSheet } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nimport type {\n BottomTabBarProps,\n BottomTabDescriptorMap,\n BottomTabHeaderProps,\n BottomTabNavigationConfig,\n BottomTabNavigationHelpers,\n BottomTabNavigationProp,\n} from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport BottomTabBarHeightContext from '../utils/BottomTabBarHeightContext';\nimport BottomTabBar, { getTabBarHeight } from './BottomTabBar';\nimport { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';\n\ntype Props = BottomTabNavigationConfig & {\n state: TabNavigationState<ParamListBase>;\n navigation: BottomTabNavigationHelpers;\n descriptors: BottomTabDescriptorMap;\n};\n\nexport default function BottomTabView(props: Props) {\n const {\n tabBar = (props: BottomTabBarProps) => <BottomTabBar {...props} />,\n state,\n navigation,\n descriptors,\n safeAreaInsets,\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n sceneContainerStyle,\n } = props;\n\n const focusedRouteKey = state.routes[state.index].key;\n const [loaded, setLoaded] = React.useState([focusedRouteKey]);\n\n if (!loaded.includes(focusedRouteKey)) {\n setLoaded([...loaded, focusedRouteKey]);\n }\n\n const dimensions = SafeAreaProviderCompat.initialMetrics.frame;\n const [tabBarHeight, setTabBarHeight] = React.useState(() =>\n getTabBarHeight({\n state,\n descriptors,\n dimensions,\n layout: { width: dimensions.width, height: 0 },\n insets: {\n ...SafeAreaProviderCompat.initialMetrics.insets,\n ...props.safeAreaInsets,\n },\n style: descriptors[state.routes[state.index].key].options.tabBarStyle,\n })\n );\n\n const renderTabBar = () => {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) =>\n tabBar({\n state: state,\n descriptors: descriptors,\n navigation: navigation,\n insets: {\n top: safeAreaInsets?.top ?? insets?.top ?? 0,\n right: safeAreaInsets?.right ?? insets?.right ?? 0,\n bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,\n left: safeAreaInsets?.left ?? insets?.left ?? 0,\n },\n })\n }\n </SafeAreaInsetsContext.Consumer>\n );\n };\n\n const { routes } = state;\n\n return (\n <SafeAreaProviderCompat>\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n hasTwoStates\n style={styles.container}\n >\n {routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const { lazy = true, unmountOnBlur } = descriptor.options;\n const isFocused = state.index === index;\n\n if (unmountOnBlur && !isFocused) {\n return null;\n }\n\n if (lazy && !loaded.includes(route.key) && !isFocused) {\n // Don't render a lazy screen if we've never navigated to it\n return null;\n }\n\n const {\n freezeOnBlur,\n header = ({ layout, options }: BottomTabHeaderProps) => (\n <Header\n {...options}\n layout={layout}\n title={getHeaderTitle(options, route.name)}\n />\n ),\n headerShown,\n headerStatusBarHeight,\n headerTransparent,\n } = descriptor.options;\n\n return (\n <MaybeScreen\n key={route.key}\n style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}\n visible={isFocused}\n enabled={detachInactiveScreens}\n freezeOnBlur={freezeOnBlur}\n >\n <BottomTabBarHeightContext.Provider value={tabBarHeight}>\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={headerShown}\n headerStatusBarHeight={headerStatusBarHeight}\n headerTransparent={headerTransparent}\n header={header({\n layout: dimensions,\n route: descriptor.route,\n navigation:\n descriptor.navigation as BottomTabNavigationProp<ParamListBase>,\n options: descriptor.options,\n })}\n style={sceneContainerStyle}\n >\n {descriptor.render()}\n </Screen>\n </BottomTabBarHeightContext.Provider>\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n <BottomTabBarHeightCallbackContext.Provider value={setTabBarHeight}>\n {renderTabBar()}\n </BottomTabBarHeightCallbackContext.Provider>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","React","Platform","StyleSheet","SafeAreaInsetsContext","BottomTabBarHeightCallbackContext","BottomTabBarHeightContext","BottomTabBar","getTabBarHeight","MaybeScreen","MaybeScreenContainer","BottomTabView","props","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","OS","sceneContainerStyle","focusedRouteKey","routes","index","key","loaded","setLoaded","useState","includes","dimensions","initialMetrics","frame","tabBarHeight","setTabBarHeight","layout","width","height","insets","style","options","tabBarStyle","renderTabBar","top","right","bottom","left","styles","container","map","route","descriptor","lazy","unmountOnBlur","isFocused","freezeOnBlur","header","name","headerShown","headerStatusBarHeight","headerTransparent","absoluteFill","zIndex","render","create","flex","overflow"],"sources":["BottomTabView.tsx"],"sourcesContent":["import {\n getHeaderTitle,\n Header,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n TabNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform, StyleSheet } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nimport type {\n BottomTabBarProps,\n BottomTabDescriptorMap,\n BottomTabHeaderProps,\n BottomTabNavigationConfig,\n BottomTabNavigationHelpers,\n BottomTabNavigationProp,\n} from '../types';\nimport BottomTabBarHeightCallbackContext from '../utils/BottomTabBarHeightCallbackContext';\nimport BottomTabBarHeightContext from '../utils/BottomTabBarHeightContext';\nimport BottomTabBar, { getTabBarHeight } from './BottomTabBar';\nimport { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';\n\ntype Props = BottomTabNavigationConfig & {\n state: TabNavigationState<ParamListBase>;\n navigation: BottomTabNavigationHelpers;\n descriptors: BottomTabDescriptorMap;\n};\n\nexport default function BottomTabView(props: Props) {\n const {\n tabBar = (props: BottomTabBarProps) => <BottomTabBar {...props} />,\n state,\n navigation,\n descriptors,\n safeAreaInsets,\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n sceneContainerStyle,\n } = props;\n\n const focusedRouteKey = state.routes[state.index].key;\n const [loaded, setLoaded] = React.useState([focusedRouteKey]);\n\n if (!loaded.includes(focusedRouteKey)) {\n setLoaded([...loaded, focusedRouteKey]);\n }\n\n const dimensions = SafeAreaProviderCompat.initialMetrics.frame;\n const [tabBarHeight, setTabBarHeight] = React.useState(() =>\n getTabBarHeight({\n state,\n descriptors,\n dimensions,\n layout: { width: dimensions.width, height: 0 },\n insets: {\n ...SafeAreaProviderCompat.initialMetrics.insets,\n ...props.safeAreaInsets,\n },\n style: descriptors[state.routes[state.index].key].options.tabBarStyle,\n })\n );\n\n const renderTabBar = () => {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) =>\n tabBar({\n state: state,\n descriptors: descriptors,\n navigation: navigation,\n insets: {\n top: safeAreaInsets?.top ?? insets?.top ?? 0,\n right: safeAreaInsets?.right ?? insets?.right ?? 0,\n bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,\n left: safeAreaInsets?.left ?? insets?.left ?? 0,\n },\n })\n }\n </SafeAreaInsetsContext.Consumer>\n );\n };\n\n const { routes } = state;\n\n return (\n <SafeAreaProviderCompat>\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n hasTwoStates\n style={styles.container}\n >\n {routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const { lazy = true, unmountOnBlur } = descriptor.options;\n const isFocused = state.index === index;\n\n if (unmountOnBlur && !isFocused) {\n return null;\n }\n\n if (lazy && !loaded.includes(route.key) && !isFocused) {\n // Don't render a lazy screen if we've never navigated to it\n return null;\n }\n\n const {\n freezeOnBlur,\n header = ({ layout, options }: BottomTabHeaderProps) => (\n <Header\n {...options}\n layout={layout}\n title={getHeaderTitle(options, route.name)}\n />\n ),\n headerShown,\n headerStatusBarHeight,\n headerTransparent,\n } = descriptor.options;\n\n return (\n <MaybeScreen\n key={route.key}\n style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}\n visible={isFocused}\n enabled={detachInactiveScreens}\n freezeOnBlur={freezeOnBlur}\n >\n <BottomTabBarHeightContext.Provider value={tabBarHeight}>\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={headerShown}\n headerStatusBarHeight={headerStatusBarHeight}\n headerTransparent={headerTransparent}\n header={header({\n layout: dimensions,\n route: descriptor.route,\n navigation:\n descriptor.navigation as BottomTabNavigationProp<ParamListBase>,\n options: descriptor.options,\n })}\n style={sceneContainerStyle}\n >\n {descriptor.render()}\n </Screen>\n </BottomTabBarHeightContext.Provider>\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n <BottomTabBarHeightCallbackContext.Provider value={setTabBarHeight}>\n {renderTabBar()}\n </BottomTabBarHeightCallbackContext.Provider>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;AAAA,SACEA,cADF,EAEEC,MAFF,EAGEC,sBAHF,EAIEC,MAJF,QAKO,4BALP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,cAArC;AACA,SAASC,qBAAT,QAAsC,gCAAtC;AAUA,OAAOC,iCAAP,MAA8C,4CAA9C;AACA,OAAOC,yBAAP,MAAsC,oCAAtC;AACA,OAAOC,YAAP,IAAuBC,eAAvB,QAA8C,gBAA9C;AACA,SAASC,WAAT,EAAsBC,oBAAtB,QAAkD,kBAAlD;AAQA,eAAe,SAASC,aAAT,CAAuBC,KAAvB,EAAqC;EAClD,MAAM;IACJC,MAAM,GAAID,KAAD,iBAA8B,oBAAC,YAAD,EAAkBA,KAAlB,CADnC;IAEJE,KAFI;IAGJC,UAHI;IAIJC,WAJI;IAKJC,cALI;IAMJC,qBAAqB,GAAGhB,QAAQ,CAACiB,EAAT,KAAgB,KAAhB,IACtBjB,QAAQ,CAACiB,EAAT,KAAgB,SADM,IAEtBjB,QAAQ,CAACiB,EAAT,KAAgB,KARd;IASJC;EATI,IAUFR,KAVJ;EAYA,MAAMS,eAAe,GAAGP,KAAK,CAACQ,MAAN,CAAaR,KAAK,CAACS,KAAnB,EAA0BC,GAAlD;EACA,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsBzB,KAAK,CAAC0B,QAAN,CAAe,CAACN,eAAD,CAAf,CAA5B;;EAEA,IAAI,CAACI,MAAM,CAACG,QAAP,CAAgBP,eAAhB,CAAL,EAAuC;IACrCK,SAAS,CAAC,CAAC,GAAGD,MAAJ,EAAYJ,eAAZ,CAAD,CAAT;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rB,UAAU,CAACyD,YAAZ,EAA0B;QAAEC,MAAM,EAAER,SAAS,GAAG,CAAH,GAAO,CAAC;MAA3B,CAA1B,CAFT;MAGE,OAAO,EAAEA,SAHX;MAIE,OAAO,EAAEnC,qBAJX;MAKE,YAAY,EAAEoC;IALhB,gBAOE,oBAAC,yBAAD,CAA2B,QAA3B;MAAoC,KAAK,EAAEtB;IAA3C,gBACE,oBAAC,MAAD;MACE,OAAO,EAAEqB,SADX;MAEE,KAAK,EAAEH,UAAU,CAACD,KAFpB;MAGE,UAAU,EAAEC,UAAU,CAACnC,UAHzB;MAIE,WAAW,EAAE0C,WAJf;MAKE,qBAAqB,EAAEC,qBALzB;MAME,iBAAiB,EAAEC,iBANrB;MAOE,MAAM,EAAEJ,MAAM,CAAC;QACbrB,MAAM,EAAEL,UADK;QAEboB,KAAK,EAAEC,UAAU,CAACD,KAFL;QAGblC,UAAU,EACRmC,UAAU,CAACnC,UAJA;QAKbwB,OAAO,EAAEW,UAAU,CAACX;MALP,CAAD,CAPhB;MAcE,KAAK,EAAEnB;IAdT,GAgBG8B,UAAU,CAACY,MAAX,EAhBH,CADF,CAPF,CADF;EA8BD,CA1DA,CALH,CADF,eAkEE,oBAAC,iCAAD,CAAmC,QAAnC;IAA4C,KAAK,EAAE7B;EAAnD,GACGQ,YAAY,EADf,CAlEF,CADF;AAwED;AAED,MAAMK,MAAM,GAAG3C,UAAU,CAAC4D,MAAX,CAAkB;EAC/BhB,SAAS,EAAE;IACTiB,IAAI,EAAE,CADG;IAETC,QAAQ,EAAE;EAFD;AADoB,CAAlB,CAAf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import { ResourceSavingView } from '@react-navigation/elements';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sources":["ScreenFallback.tsx"],"sourcesContent":["import { ResourceSavingView } from '@react-navigation/elements';\nimport * as React from 'react';\nimport { StyleProp, View, ViewProps, ViewStyle } from 'react-native';\n\ntype Props = {\n visible: boolean;\n children: React.ReactNode;\n enabled: boolean;\n freezeOnBlur?: boolean;\n style?: StyleProp<ViewStyle>;\n};\n\nlet Screens: typeof import('react-native-screens') | undefined;\n\ntry {\n Screens = require('react-native-screens');\n} catch (e) {\n // Ignore\n}\n\nexport const MaybeScreenContainer = ({\n enabled,\n ...rest\n}: ViewProps & {\n enabled: boolean;\n hasTwoStates: boolean;\n children: React.ReactNode;\n}) => {\n if (Screens?.screensEnabled?.()) {\n return <Screens.ScreenContainer enabled={enabled} {...rest} />;\n }\n\n return <View {...rest} />;\n};\n\nexport function MaybeScreen({ visible, children, ...rest }: Props) {\n if (Screens?.screensEnabled?.()) {\n return (\n <Screens.Screen activityState={visible ? 2 : 0} {...rest}>\n {children}\n </Screens.Screen>\n );\n }\n\n return (\n <ResourceSavingView visible={visible} {...rest}>\n {children}\n </ResourceSavingView>\n );\n}\n"],"mappings":";;AAAA,SAASA,kBAAT,QAAmC,4BAAnC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAoBC,IAApB,QAAsD,cAAtD;AAUA,IAAIC,OAAJ;;AAEA,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAD,CAAjB;AACD,CAFD,CAEE,OAAOC,CAAP,EAAU,CACV;AACD;;AAED,OAAO,MAAMC,oBAAoB,GAAG,QAO9B;EAAA;;EAAA,IAP+B;IACnCC,OADmC;IAEnC,GAAGC;EAFgC,CAO/B;;EACJ,gBAAIL,OAAJ,8DAAI,SAASM,cAAb,kDAAI,oCAAJ,EAAiC;IAC/B,oBAAO,oBAAC,OAAD,CAAS,eAAT;MAAyB,OAAO,EAAEF;IAAlC,GAA+CC,IAA/C,EAAP;EACD;;EAED,oBAAO,oBAAC,IAAD,EAAUA,IAAV,CAAP;AACD,CAbM;AAeP,OAAO,SAASE,WAAT,QAA4D;EAAA;;EAAA,IAAvC;IAAEC,OAAF;IAAWC,QAAX;IAAqB,GAAGJ;EAAxB,CAAuC;;EACjE,iBAAIL,OAAJ,+DAAI,UAASM,cAAb,kDAAI,qCAAJ,EAAiC;IAC/B,oBACE,oBAAC,OAAD,CAAS,MAAT;MAAgB,aAAa,EAAEE,OAAO,GAAG,CAAH,GAAO;IAA7C,GAAoDH,IAApD,GACGI,QADH,CADF;EAKD;;EAED,oBACE,oBAAC,kBAAD;IAAoB,OAAO,EAAED;EAA7B,GAA0CH,IAA1C,GACGI,QADH,CADF;AAKD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Badge","TabBarIcon","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","size","styles","iconHorizontal","iconVertical","icon","opacity","focused","color","badgeHorizontal","badgeVertical","create","position","alignSelf","alignItems","justifyContent","height","width","minWidth","flex","marginTop","left","top"],"sources":["TabBarIcon.tsx"],"sourcesContent":["import type { Route } from '@react-navigation/native';\nimport React from 'react';\nimport {\n StyleProp,\n StyleSheet,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport Badge from './Badge';\n\ntype Props = {\n route: Route<string>;\n horizontal: boolean;\n badge?: string | number;\n badgeStyle?: StyleProp<TextStyle>;\n activeOpacity: number;\n inactiveOpacity: number;\n activeTintColor: string;\n inactiveTintColor: string;\n renderIcon: (props: {\n focused: boolean;\n color: string;\n size: number;\n }) => React.ReactNode;\n style: StyleProp<ViewStyle>;\n};\n\nexport default function TabBarIcon({\n route: _,\n horizontal,\n badge,\n badgeStyle,\n activeOpacity,\n inactiveOpacity,\n activeTintColor,\n inactiveTintColor,\n renderIcon,\n style,\n}: Props) {\n const size = 25;\n\n // We render the icon twice at the same position on top of each other:\n // active and inactive one, so we can fade between them.\n return (\n <View\n style={[horizontal ? styles.iconHorizontal : styles.iconVertical, style]}\n >\n <View style={[styles.icon, { opacity: activeOpacity }]}>\n {renderIcon({\n focused: true,\n size,\n color: activeTintColor,\n })}\n </View>\n <View style={[styles.icon, { opacity: inactiveOpacity }]}>\n {renderIcon({\n focused: false,\n size,\n color: inactiveTintColor,\n })}\n </View>\n <Badge\n visible={badge != null}\n style={[\n styles.badge,\n horizontal ? styles.badgeHorizontal : styles.badgeVertical,\n badgeStyle,\n ]}\n size={(size * 3) / 4}\n >\n {badge}\n </Badge>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n icon: {\n // We render the icon twice at the same position on top of each other:\n // active and inactive one, so we can fade between them:\n // Cover the whole iconContainer:\n position: 'absolute',\n alignSelf: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%',\n width: '100%',\n // Workaround for react-native >= 0.54 layout bug\n minWidth: 25,\n },\n iconVertical: {\n flex: 1,\n },\n iconHorizontal: {\n height: '100%',\n marginTop: 3,\n },\n badge: {\n position: 'absolute',\n left: 3,\n },\n badgeVertical: {\n top: 3,\n },\n badgeHorizontal: {\n top: 7,\n },\n});\n"],"mappings":"AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAEEC,UAFF,EAIEC,IAJF,QAMO,cANP;AAQA,OAAOC,KAAP,MAAkB,SAAlB;AAmBA,eAAe,SAASC,UAAT,OAWL;EAAA,IAXyB;IACjCC,KAAK,EAAEC,CAD0B;IAEjCC,UAFiC;IAGjCC,KAHiC;IAIjCC,UAJiC;IAKjCC,aALiC;IAMjCC,eANiC;IAOjCC,eAPiC;IAQjCC,iBARiC;IASjCC,UATiC;IAUjCC;EAViC,CAWzB;EAC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,EAAE;EAFG,CAjBe;EAqB/B3B,KAAK,EAAE;IACLmB,QAAQ,EAAE,UADL;IAELS,IAAI,EAAE;EAFD,CArBwB;EAyB/BX,aAAa,EAAE;IACbY,GAAG,EAAE;EADQ,CAzBgB;EA4B/Bb,eAAe,EAAE;IACfa,GAAG,EAAE;EADU;AA5Bc,CAAlB,CAAf"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/bottom-tabs",
|
|
3
3
|
"description": "Bottom tab navigator following iOS design guidelines",
|
|
4
|
-
"version": "6.4.
|
|
4
|
+
"version": "6.4.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"clean": "del lib"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-navigation/elements": "^1.3.
|
|
39
|
+
"@react-navigation/elements": "^1.3.7",
|
|
40
40
|
"color": "^4.2.3",
|
|
41
41
|
"warn-once": "^0.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@react-navigation/native": "^6.0.
|
|
45
|
-
"@testing-library/react-native": "^
|
|
44
|
+
"@react-navigation/native": "^6.0.14",
|
|
45
|
+
"@testing-library/react-native": "^11.5.0",
|
|
46
46
|
"@types/color": "^3.0.1",
|
|
47
47
|
"@types/react": "~18.0.0",
|
|
48
48
|
"@types/react-native": "~0.69.1",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
]
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "92f9f265d2627a3ef5b3890042d59405ff38401e"
|
|
79
79
|
}
|