@react-navigation/bottom-tabs 6.4.3 → 6.5.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 +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createBottomTabNavigator.js +1 -17
- package/lib/commonjs/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js +0 -5
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js.map +1 -1
- package/lib/commonjs/utils/BottomTabBarHeightContext.js +0 -5
- package/lib/commonjs/utils/BottomTabBarHeightContext.js.map +1 -1
- package/lib/commonjs/utils/useBottomTabBarHeight.js +2 -10
- package/lib/commonjs/utils/useBottomTabBarHeight.js.map +1 -1
- package/lib/commonjs/utils/useIsKeyboardShown.js +0 -9
- package/lib/commonjs/utils/useIsKeyboardShown.js.map +1 -1
- package/lib/commonjs/views/Badge.js +2 -16
- package/lib/commonjs/views/Badge.js.map +1 -1
- package/lib/commonjs/views/BottomTabBar.js +5 -51
- package/lib/commonjs/views/BottomTabBar.js.map +1 -1
- package/lib/commonjs/views/BottomTabItem.js +9 -21
- package/lib/commonjs/views/BottomTabItem.js.map +1 -1
- package/lib/commonjs/views/BottomTabView.js +15 -39
- package/lib/commonjs/views/BottomTabView.js.map +1 -1
- package/lib/commonjs/views/ScreenFallback.js +2 -18
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/commonjs/views/TabBarIcon.js +3 -8
- package/lib/commonjs/views/TabBarIcon.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createBottomTabNavigator.js +1 -9
- 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 +1 -3
- package/lib/module/utils/useBottomTabBarHeight.js.map +1 -1
- package/lib/module/utils/useIsKeyboardShown.js +0 -4
- package/lib/module/utils/useIsKeyboardShown.js.map +1 -1
- package/lib/module/views/Badge.js +2 -6
- package/lib/module/views/Badge.js.map +1 -1
- package/lib/module/views/BottomTabBar.js +5 -29
- package/lib/module/views/BottomTabBar.js.map +1 -1
- package/lib/module/views/BottomTabItem.js +9 -13
- package/lib/module/views/BottomTabItem.js.map +1 -1
- package/lib/module/views/BottomTabView.js +15 -26
- package/lib/module/views/BottomTabView.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +2 -10
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/module/views/TabBarIcon.js +3 -2
- package/lib/module/views/TabBarIcon.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts +1 -0
- package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +3 -1
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/BottomTabBarHeightCallbackContext.d.ts +1 -0
- package/lib/typescript/src/utils/BottomTabBarHeightCallbackContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts +1 -0
- package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts +2 -1
- package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts.map +1 -0
- package/lib/typescript/src/utils/useIsKeyboardShown.d.ts +1 -0
- package/lib/typescript/src/utils/useIsKeyboardShown.d.ts.map +1 -0
- package/lib/typescript/src/views/Badge.d.ts +1 -0
- package/lib/typescript/src/views/Badge.d.ts.map +1 -0
- package/lib/typescript/src/views/BottomTabBar.d.ts +1 -0
- package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -0
- package/lib/typescript/src/views/BottomTabItem.d.ts +8 -2
- package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -0
- package/lib/typescript/src/views/BottomTabView.d.ts +1 -0
- package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -0
- package/lib/typescript/src/views/ScreenFallback.d.ts +1 -0
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -0
- package/lib/typescript/src/views/TabBarIcon.d.ts +1 -0
- package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/types.tsx +2 -1
- package/src/utils/useBottomTabBarHeight.tsx +1 -1
- package/src/views/BottomTabBar.tsx +1 -0
- package/src/views/BottomTabItem.tsx +20 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -39,18 +39,11 @@ Object.defineProperty(exports, "useBottomTabBarHeight", {
|
|
|
39
39
|
return _useBottomTabBarHeight.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
|
|
43
42
|
var _createBottomTabNavigator = _interopRequireDefault(require("./navigators/createBottomTabNavigator"));
|
|
44
|
-
|
|
45
43
|
var _BottomTabBar = _interopRequireDefault(require("./views/BottomTabBar"));
|
|
46
|
-
|
|
47
44
|
var _BottomTabView = _interopRequireDefault(require("./views/BottomTabView"));
|
|
48
|
-
|
|
49
45
|
var _BottomTabBarHeightCallbackContext = _interopRequireDefault(require("./utils/BottomTabBarHeightCallbackContext"));
|
|
50
|
-
|
|
51
46
|
var _BottomTabBarHeightContext = _interopRequireDefault(require("./utils/BottomTabBarHeightContext"));
|
|
52
|
-
|
|
53
47
|
var _useBottomTabBarHeight = _interopRequireDefault(require("./utils/useBottomTabBarHeight"));
|
|
54
|
-
|
|
55
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAKA;AACA;AAKA;AACA;AACA;AAAiF"}
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _native = require("@react-navigation/native");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _warnOnce = _interopRequireDefault(require("warn-once"));
|
|
13
|
-
|
|
14
10
|
var _BottomTabView = _interopRequireDefault(require("../views/BottomTabView"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
13
|
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
|
-
|
|
22
14
|
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
|
-
|
|
24
15
|
function BottomTabNavigator(_ref) {
|
|
25
16
|
let {
|
|
26
17
|
id,
|
|
@@ -40,10 +31,7 @@ function BottomTabNavigator(_ref) {
|
|
|
40
31
|
...rest
|
|
41
32
|
} = restWithDeprecated;
|
|
42
33
|
let defaultScreenOptions = {};
|
|
43
|
-
|
|
44
34
|
if (tabBarOptions) {
|
|
45
|
-
var _tabBarOptions$labelP;
|
|
46
|
-
|
|
47
35
|
Object.assign(defaultScreenOptions, {
|
|
48
36
|
tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,
|
|
49
37
|
tabBarActiveTintColor: tabBarOptions.activeTintColor,
|
|
@@ -55,7 +43,7 @@ function BottomTabNavigator(_ref) {
|
|
|
55
43
|
tabBarLabelStyle: tabBarOptions.labelStyle,
|
|
56
44
|
tabBarIconStyle: tabBarOptions.iconStyle,
|
|
57
45
|
tabBarItemStyle: tabBarOptions.tabStyle,
|
|
58
|
-
tabBarLabelPosition:
|
|
46
|
+
tabBarLabelPosition: tabBarOptions.labelPosition ?? (tabBarOptions.adaptive === false ? 'below-icon' : undefined),
|
|
59
47
|
tabBarStyle: [{
|
|
60
48
|
display: tabBarOptions.tabBarVisible ? 'none' : 'flex'
|
|
61
49
|
}, defaultScreenOptions.tabBarStyle]
|
|
@@ -68,12 +56,10 @@ function BottomTabNavigator(_ref) {
|
|
|
68
56
|
});
|
|
69
57
|
(0, _warnOnce.default)(tabBarOptions, `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(defaultScreenOptions, null, 2)}\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
59
|
if (typeof lazy === 'boolean') {
|
|
73
60
|
defaultScreenOptions.lazy = lazy;
|
|
74
61
|
(0, _warnOnce.default)(true, `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.`);
|
|
75
62
|
}
|
|
76
|
-
|
|
77
63
|
const {
|
|
78
64
|
state,
|
|
79
65
|
descriptors,
|
|
@@ -95,8 +81,6 @@ function BottomTabNavigator(_ref) {
|
|
|
95
81
|
sceneContainerStyle: sceneContainerStyle
|
|
96
82
|
})));
|
|
97
83
|
}
|
|
98
|
-
|
|
99
84
|
var _default = (0, _native.createNavigatorFactory)(BottomTabNavigator);
|
|
100
|
-
|
|
101
85
|
exports.default = _default;
|
|
102
86
|
//# sourceMappingURL=createBottomTabNavigator.js.map
|
|
@@ -1 +1 @@
|
|
|
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"],"
|
|
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"],"sourceRoot":"../../src","sources":["createBottomTabNavigator.tsx"],"mappings":";;;;;;AAAA;AAUA;AACA;AAOA;AAAmD;AAAA;AAAA;AAAA;AAWnD,SAASA,kBAAkB,OASjB;EAAA,IATkB;IAC1BC,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbC,mBAAmB;IACnB,GAAGC;EACE,CAAC;EACN,MAAM;IACJ;IACAC,IAAI;IACJ;IACAC,aAAa;IACb,GAAGC;EACL,CAAC,GAAGH,kBAAkB;EAEtB,IAAII,oBAAgD,GAAG,CAAC,CAAC;EAEzD,IAAIF,aAAa,EAAE;IACjBG,MAAM,CAACC,MAAM,CAACF,oBAAoB,EAAE;MAClCG,oBAAoB,EAAEL,aAAa,CAACM,mBAAmB;MACvDC,qBAAqB,EAAEP,aAAa,CAACQ,eAAe;MACpDC,uBAAuB,EAAET,aAAa,CAACU,iBAAiB;MACxDC,2BAA2B,EAAEX,aAAa,CAACY,qBAAqB;MAChEC,6BAA6B,EAAEb,aAAa,CAACc,uBAAuB;MACpEC,sBAAsB,EAAEf,aAAa,CAACgB,gBAAgB;MACtDC,eAAe,EAAEjB,aAAa,CAACkB,SAAS;MACxCC,gBAAgB,EAAEnB,aAAa,CAACoB,UAAU;MAC1CC,eAAe,EAAErB,aAAa,CAACsB,SAAS;MACxCC,eAAe,EAAEvB,aAAa,CAACwB,QAAQ;MACvCC,mBAAmB,EACjBzB,aAAa,CAAC0B,aAAa,KAC1B1B,aAAa,CAAC2B,QAAQ,KAAK,KAAK,GAAG,YAAY,GAAGC,SAAS,CAAC;MAC/DC,WAAW,EAAE,CACX;QAAEC,OAAO,EAAE9B,aAAa,CAAC+B,aAAa,GAAG,MAAM,GAAG;MAAO,CAAC,EAC1D7B,oBAAoB,CAAC2B,WAAW;IAEpC,CAAC,CAAC;IAGA1B,MAAM,CAAC6B,IAAI,CAAC9B,oBAAoB,CAAC,CACjC+B,OAAO,CAAEC,GAAG,IAAK;MACjB,IAAIhC,oBAAoB,CAACgC,GAAG,CAAC,KAAKN,SAAS,EAAE;QAC3C;QACA,OAAO1B,oBAAoB,CAACgC,GAAG,CAAC;MAClC;IACF,CAAC,CAAC;IAEF,IAAAC,iBAAQ,EACNnC,aAAa,EACZ,4LAA2LoC,IAAI,CAACC,SAAS,CACxMnC,oBAAoB,EACpB,IAAI,EACJ,CAAC,CACD,yFAAwF,CAC3F;EACH;EAEA,IAAI,OAAOH,IAAI,KAAK,SAAS,EAAE;IAC7BG,oBAAoB,CAACH,IAAI,GAAGA,IAAI;IAEhC,IAAAoC,iBAAQ,EACN,IAAI,EACH,+KAA8K,CAChL;EACH;EAEA,MAAM;IAAEG,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzD,IAAAC,4BAAoB,EAMlBC,iBAAS,EAAE;IACXpD,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbM;EACF,CAAC,CAAC;EAEJ,oBACE,oBAAC,iBAAiB,qBAChB,oBAAC,sBAAa,eACRD,IAAI;IACR,KAAK,EAAEqC,KAAM;IACb,UAAU,EAAEE,UAAW;IACvB,WAAW,EAAED,WAAY;IACzB,mBAAmB,EAAE1C;EAAoB,GACzC,CACgB;AAExB;AAAC,eAEc,IAAA+C,8BAAsB,EAKnCtD,kBAAkB,CAAC;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
|
|
@@ -4,14 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
|
|
12
9
|
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; }
|
|
13
|
-
|
|
14
10
|
var _default = /*#__PURE__*/React.createContext(undefined);
|
|
15
|
-
|
|
16
11
|
exports.default = _default;
|
|
17
12
|
//# sourceMappingURL=BottomTabBarHeightCallbackContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","undefined"],"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightCallbackContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAChCC,SAAS,CACV;AAAA"}
|
|
@@ -4,14 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
|
|
12
9
|
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; }
|
|
13
|
-
|
|
14
10
|
var _default = /*#__PURE__*/React.createContext(undefined);
|
|
15
|
-
|
|
16
11
|
exports.default = _default;
|
|
17
12
|
//# sourceMappingURL=BottomTabBarHeightContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","undefined"],"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["BottomTabBarHeightContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAAqBC,SAAS,CAAC;AAAA"}
|
|
@@ -3,25 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
7
|
-
|
|
6
|
+
exports.default = useBottomTabBarHeight;
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _BottomTabBarHeightContext = _interopRequireDefault(require("./BottomTabBarHeightContext"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
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; }
|
|
17
|
-
|
|
18
|
-
function useFloatingBottomTabBarHeight() {
|
|
12
|
+
function useBottomTabBarHeight() {
|
|
19
13
|
const height = React.useContext(_BottomTabBarHeightContext.default);
|
|
20
|
-
|
|
21
14
|
if (height === undefined) {
|
|
22
15
|
throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?");
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
return height;
|
|
26
18
|
}
|
|
27
19
|
//# sourceMappingURL=useBottomTabBarHeight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useBottomTabBarHeight","height","React","useContext","BottomTabBarHeightContext","undefined","Error"],"sourceRoot":"../../src","sources":["useBottomTabBarHeight.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAoE;AAAA;AAAA;AAErD,SAASA,qBAAqB,GAAG;EAC9C,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAU,CAACC,kCAAyB,CAAC;EAE1D,IAAIH,MAAM,KAAKI,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,2FAA2F,CAC5F;EACH;EAEA,OAAOL,MAAM;AACf"}
|
|
@@ -4,30 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useIsKeyboardShown;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
|
|
14
10
|
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; }
|
|
15
|
-
|
|
16
11
|
function useIsKeyboardShown() {
|
|
17
12
|
const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);
|
|
18
13
|
React.useEffect(() => {
|
|
19
14
|
const handleKeyboardShow = () => setIsKeyboardShown(true);
|
|
20
|
-
|
|
21
15
|
const handleKeyboardHide = () => setIsKeyboardShown(false);
|
|
22
|
-
|
|
23
16
|
let subscriptions;
|
|
24
|
-
|
|
25
17
|
if (_reactNative.Platform.OS === 'ios') {
|
|
26
18
|
subscriptions = [_reactNative.Keyboard.addListener('keyboardWillShow', handleKeyboardShow), _reactNative.Keyboard.addListener('keyboardWillHide', handleKeyboardHide)];
|
|
27
19
|
} else {
|
|
28
20
|
subscriptions = [_reactNative.Keyboard.addListener('keyboardDidShow', handleKeyboardShow), _reactNative.Keyboard.addListener('keyboardDidHide', handleKeyboardHide)];
|
|
29
21
|
}
|
|
30
|
-
|
|
31
22
|
return () => {
|
|
32
23
|
subscriptions.forEach(s => s.remove());
|
|
33
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","React","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","Platform","OS","Keyboard","addListener","forEach","s","remove"],"
|
|
1
|
+
{"version":3,"names":["useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","React","useState","useEffect","handleKeyboardShow","handleKeyboardHide","subscriptions","Platform","OS","Keyboard","addListener","forEach","s","remove"],"sourceRoot":"../../src","sources":["useIsKeyboardShown.tsx"],"mappings":";;;;;;AAAA;AACA;AAAuE;AAAA;AAExD,SAASA,kBAAkB,GAAG;EAC3C,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EAEnED,KAAK,CAACE,SAAS,CAAC,MAAM;IACpB,MAAMC,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,IAAI,CAAC;IACzD,MAAMK,kBAAkB,GAAG,MAAML,kBAAkB,CAAC,KAAK,CAAC;IAE1D,IAAIM,aAAoC;IAExC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBF,aAAa,GAAG,CACdG,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAEN,kBAAkB,CAAC,EAC5DK,qBAAQ,CAACC,WAAW,CAAC,kBAAkB,EAAEL,kBAAkB,CAAC,CAC7D;IACH,CAAC,MAAM;MACLC,aAAa,GAAG,CACdG,qBAAQ,CAACC,WAAW,CAAC,iBAAiB,EAAEN,kBAAkB,CAAC,EAC3DK,qBAAQ,CAACC,WAAW,CAAC,iBAAiB,EAAEL,kBAAkB,CAAC,CAC5D;IACH;IAEA,OAAO,MAAM;MACXC,aAAa,CAACK,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACC,MAAM,EAAE,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOd,eAAe;AACxB"}
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Badge;
|
|
7
|
-
|
|
8
7
|
var _native = require("@react-navigation/native");
|
|
9
|
-
|
|
10
8
|
var _color = _interopRequireDefault(require("color"));
|
|
11
|
-
|
|
12
9
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _reactNative = require("react-native");
|
|
15
|
-
|
|
16
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
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
|
-
|
|
24
15
|
function Badge(_ref) {
|
|
25
16
|
let {
|
|
26
17
|
children,
|
|
@@ -36,7 +27,6 @@ function Badge(_ref) {
|
|
|
36
27
|
if (!rendered) {
|
|
37
28
|
return;
|
|
38
29
|
}
|
|
39
|
-
|
|
40
30
|
_reactNative.Animated.timing(opacity, {
|
|
41
31
|
toValue: visible ? 1 : 0,
|
|
42
32
|
duration: 150,
|
|
@@ -45,24 +35,21 @@ function Badge(_ref) {
|
|
|
45
35
|
let {
|
|
46
36
|
finished
|
|
47
37
|
} = _ref2;
|
|
48
|
-
|
|
49
38
|
if (finished && !visible) {
|
|
50
39
|
setRendered(false);
|
|
51
40
|
}
|
|
52
41
|
});
|
|
53
|
-
|
|
54
42
|
return () => opacity.stopAnimation();
|
|
55
43
|
}, [opacity, rendered, visible]);
|
|
56
|
-
|
|
57
44
|
if (!rendered) {
|
|
58
45
|
if (visible) {
|
|
59
46
|
setRendered(true);
|
|
60
47
|
} else {
|
|
61
48
|
return null;
|
|
62
49
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
50
|
+
}
|
|
65
51
|
|
|
52
|
+
// @ts-expect-error: backgroundColor definitely exists
|
|
66
53
|
const {
|
|
67
54
|
backgroundColor = theme.colors.notification,
|
|
68
55
|
...restStyle
|
|
@@ -90,7 +77,6 @@ function Badge(_ref) {
|
|
|
90
77
|
}, styles.container, restStyle]
|
|
91
78
|
}, rest), children);
|
|
92
79
|
}
|
|
93
|
-
|
|
94
80
|
const styles = _reactNative.StyleSheet.create({
|
|
95
81
|
container: {
|
|
96
82
|
alignSelf: 'flex-end',
|
|
@@ -1 +1 @@
|
|
|
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"],"
|
|
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"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAA0E;AAAA;AAAA;AAAA;AAqB3D,SAASA,KAAK,OAMnB;EAAA,IANoB;IAC5BC,QAAQ;IACRC,KAAK;IACLC,OAAO,GAAG,IAAI;IACdC,IAAI,GAAG,EAAE;IACT,GAAGC;EACE,CAAC;EACN,MAAM,CAACC,OAAO,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,MAAM,IAAIC,qBAAQ,CAACC,KAAK,CAACP,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EAC3E,MAAM,CAACQ,QAAQ,EAAEC,WAAW,CAAC,GAAGL,KAAK,CAACC,QAAQ,CAACL,OAAO,CAAC;EAEvD,MAAMU,KAAK,GAAG,IAAAC,gBAAQ,GAAE;EAExBP,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,IAAI,CAACJ,QAAQ,EAAE;MACb;IACF;IAEAF,qBAAQ,CAACO,MAAM,CAACV,OAAO,EAAE;MACvBW,OAAO,EAAEd,OAAO,GAAG,CAAC,GAAG,CAAC;MACxBe,QAAQ,EAAE,GAAG;MACbC,eAAe,EAAE;IACnB,CAAC,CAAC,CAACC,KAAK,CAAC,SAAkB;MAAA,IAAjB;QAAEC;MAAS,CAAC;MACpB,IAAIA,QAAQ,IAAI,CAAClB,OAAO,EAAE;QACxBS,WAAW,CAAC,KAAK,CAAC;MACpB;IACF,CAAC,CAAC;IAEF,OAAO,MAAMN,OAAO,CAACgB,aAAa,EAAE;EACtC,CAAC,EAAE,CAAChB,OAAO,EAAEK,QAAQ,EAAER,OAAO,CAAC,CAAC;EAEhC,IAAI,CAACQ,QAAQ,EAAE;IACb,IAAIR,OAAO,EAAE;MACXS,WAAW,CAAC,IAAI,CAAC;IACnB,CAAC,MAAM;MACL,OAAO,IAAI;IACb;EACF;;EAEA;EACA,MAAM;IAAEW,eAAe,GAAGV,KAAK,CAACW,MAAM,CAACC,YAAY;IAAE,GAAGC;EAAU,CAAC,GACjEC,uBAAU,CAACC,OAAO,CAAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;EACjC,MAAM2B,SAAS,GAAG,IAAAC,cAAK,EAACP,eAAe,CAAC,CAACQ,OAAO,EAAE,GAAG,OAAO,GAAG,OAAO;EAEtE,MAAMC,YAAY,GAAG5B,IAAI,GAAG,CAAC;EAC7B,MAAM6B,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAAE/B,IAAI,GAAG,CAAC,GAAI,CAAC,CAAC;EAE3C,oBACE,oBAAC,qBAAQ,CAAC,IAAI;IACZ,aAAa,EAAE,CAAE;IACjB,KAAK,EAAE,CACL;MACEgC,SAAS,EAAE,CACT;QACEC,KAAK,EAAE/B,OAAO,CAACgC,WAAW,CAAC;UACzBC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;UAClBC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;MACH,CAAC,CACF;MACDV,KAAK,EAAED,SAAS;MAChBY,UAAU,EAAErC,IAAI,GAAG,CAAC;MACpBsC,MAAM,EAAEtC,IAAI;MACZuC,QAAQ,EAAEvC,IAAI;MACdE,OAAO;MACPiB,eAAe;MACfU,QAAQ;MACRD;IACF,CAAC,EACDY,MAAM,CAACC,SAAS,EAChBnB,SAAS;EACT,GACErB,IAAI,GAEPJ,QAAQ,CACK;AAEpB;AAEA,MAAM2C,MAAM,GAAGjB,uBAAU,CAACmB,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UAAU;IACrBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC"}
|
|
@@ -5,30 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = BottomTabBar;
|
|
7
7
|
exports.getTabBarHeight = void 0;
|
|
8
|
-
|
|
9
8
|
var _elements = require("@react-navigation/elements");
|
|
10
|
-
|
|
11
9
|
var _native = require("@react-navigation/native");
|
|
12
|
-
|
|
13
10
|
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
|
|
15
11
|
var _reactNative = require("react-native");
|
|
16
|
-
|
|
17
12
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
18
|
-
|
|
19
13
|
var _BottomTabBarHeightCallbackContext = _interopRequireDefault(require("../utils/BottomTabBarHeightCallbackContext"));
|
|
20
|
-
|
|
21
14
|
var _useIsKeyboardShown = _interopRequireDefault(require("../utils/useIsKeyboardShown"));
|
|
22
|
-
|
|
23
15
|
var _BottomTabItem = _interopRequireDefault(require("./BottomTabItem"));
|
|
24
|
-
|
|
25
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
17
|
const DEFAULT_TABBAR_HEIGHT = 49;
|
|
28
18
|
const COMPACT_TABBAR_HEIGHT = 32;
|
|
29
19
|
const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
|
|
30
20
|
const useNativeDriver = _reactNative.Platform.OS !== 'web';
|
|
31
|
-
|
|
32
21
|
const shouldUseHorizontalLabels = _ref => {
|
|
33
22
|
let {
|
|
34
23
|
state,
|
|
@@ -39,26 +28,21 @@ const shouldUseHorizontalLabels = _ref => {
|
|
|
39
28
|
const {
|
|
40
29
|
tabBarLabelPosition
|
|
41
30
|
} = descriptors[state.routes[state.index].key].options;
|
|
42
|
-
|
|
43
31
|
if (tabBarLabelPosition) {
|
|
44
32
|
switch (tabBarLabelPosition) {
|
|
45
33
|
case 'beside-icon':
|
|
46
34
|
return true;
|
|
47
|
-
|
|
48
35
|
case 'below-icon':
|
|
49
36
|
return false;
|
|
50
37
|
}
|
|
51
38
|
}
|
|
52
|
-
|
|
53
39
|
if (layout.width >= 768) {
|
|
54
40
|
// Screen size matches a tablet
|
|
55
41
|
const maxTabWidth = state.routes.reduce((acc, route) => {
|
|
56
42
|
const {
|
|
57
43
|
tabBarItemStyle
|
|
58
44
|
} = descriptors[route.key].options;
|
|
59
|
-
|
|
60
45
|
const flattenedStyle = _reactNative.StyleSheet.flatten(tabBarItemStyle);
|
|
61
|
-
|
|
62
46
|
if (flattenedStyle) {
|
|
63
47
|
if (typeof flattenedStyle.width === 'number') {
|
|
64
48
|
return acc + flattenedStyle.width;
|
|
@@ -66,7 +50,6 @@ const shouldUseHorizontalLabels = _ref => {
|
|
|
66
50
|
return acc + flattenedStyle.maxWidth;
|
|
67
51
|
}
|
|
68
52
|
}
|
|
69
|
-
|
|
70
53
|
return acc + DEFAULT_MAX_TAB_ITEM_WIDTH;
|
|
71
54
|
}, 0);
|
|
72
55
|
return maxTabWidth <= layout.width;
|
|
@@ -74,15 +57,12 @@ const shouldUseHorizontalLabels = _ref => {
|
|
|
74
57
|
return dimensions.width > dimensions.height;
|
|
75
58
|
}
|
|
76
59
|
};
|
|
77
|
-
|
|
78
60
|
const getPaddingBottom = insets => Math.max(insets.bottom - _reactNative.Platform.select({
|
|
79
61
|
ios: 4,
|
|
80
62
|
default: 0
|
|
81
63
|
}), 0);
|
|
82
|
-
|
|
83
64
|
const getTabBarHeight = _ref2 => {
|
|
84
65
|
var _StyleSheet$flatten;
|
|
85
|
-
|
|
86
66
|
let {
|
|
87
67
|
state,
|
|
88
68
|
descriptors,
|
|
@@ -93,11 +73,9 @@ const getTabBarHeight = _ref2 => {
|
|
|
93
73
|
} = _ref2;
|
|
94
74
|
// @ts-ignore
|
|
95
75
|
const customHeight = (_StyleSheet$flatten = _reactNative.StyleSheet.flatten(style)) === null || _StyleSheet$flatten === void 0 ? void 0 : _StyleSheet$flatten.height;
|
|
96
|
-
|
|
97
76
|
if (typeof customHeight === 'number') {
|
|
98
77
|
return customHeight;
|
|
99
78
|
}
|
|
100
|
-
|
|
101
79
|
const isLandscape = dimensions.width > dimensions.height;
|
|
102
80
|
const horizontalLabels = shouldUseHorizontalLabels({
|
|
103
81
|
state,
|
|
@@ -106,16 +84,12 @@ const getTabBarHeight = _ref2 => {
|
|
|
106
84
|
...rest
|
|
107
85
|
});
|
|
108
86
|
const paddingBottom = getPaddingBottom(insets);
|
|
109
|
-
|
|
110
87
|
if (_reactNative.Platform.OS === 'ios' && !_reactNative.Platform.isPad && isLandscape && horizontalLabels) {
|
|
111
88
|
return COMPACT_TABBAR_HEIGHT + paddingBottom;
|
|
112
89
|
}
|
|
113
|
-
|
|
114
90
|
return DEFAULT_TABBAR_HEIGHT + paddingBottom;
|
|
115
91
|
};
|
|
116
|
-
|
|
117
92
|
exports.getTabBarHeight = getTabBarHeight;
|
|
118
|
-
|
|
119
93
|
function BottomTabBar(_ref3) {
|
|
120
94
|
let {
|
|
121
95
|
state,
|
|
@@ -144,27 +118,18 @@ function BottomTabBar(_ref3) {
|
|
|
144
118
|
} = focusedOptions;
|
|
145
119
|
const dimensions = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
|
|
146
120
|
const isKeyboardShown = (0, _useIsKeyboardShown.default)();
|
|
147
|
-
|
|
148
121
|
const onHeightChange = _react.default.useContext(_BottomTabBarHeightCallbackContext.default);
|
|
149
|
-
|
|
150
122
|
const shouldShowTabBar = !(tabBarHideOnKeyboard && isKeyboardShown);
|
|
151
|
-
|
|
152
123
|
const visibilityAnimationConfigRef = _react.default.useRef(tabBarVisibilityAnimationConfig);
|
|
153
|
-
|
|
154
124
|
_react.default.useEffect(() => {
|
|
155
125
|
visibilityAnimationConfigRef.current = tabBarVisibilityAnimationConfig;
|
|
156
126
|
});
|
|
157
|
-
|
|
158
127
|
const [isTabBarHidden, setIsTabBarHidden] = _react.default.useState(!shouldShowTabBar);
|
|
159
|
-
|
|
160
128
|
const [visible] = _react.default.useState(() => new _reactNative.Animated.Value(shouldShowTabBar ? 1 : 0));
|
|
161
|
-
|
|
162
129
|
_react.default.useEffect(() => {
|
|
163
130
|
const visibilityAnimationConfig = visibilityAnimationConfigRef.current;
|
|
164
|
-
|
|
165
131
|
if (shouldShowTabBar) {
|
|
166
132
|
var _visibilityAnimationC, _visibilityAnimationC2;
|
|
167
|
-
|
|
168
133
|
const animation = (visibilityAnimationConfig === null || visibilityAnimationConfig === void 0 ? void 0 : (_visibilityAnimationC = visibilityAnimationConfig.show) === null || _visibilityAnimationC === void 0 ? void 0 : _visibilityAnimationC.animation) === 'spring' ? _reactNative.Animated.spring : _reactNative.Animated.timing;
|
|
169
134
|
animation(visible, {
|
|
170
135
|
toValue: 1,
|
|
@@ -175,14 +140,12 @@ function BottomTabBar(_ref3) {
|
|
|
175
140
|
let {
|
|
176
141
|
finished
|
|
177
142
|
} = _ref4;
|
|
178
|
-
|
|
179
143
|
if (finished) {
|
|
180
144
|
setIsTabBarHidden(false);
|
|
181
145
|
}
|
|
182
146
|
});
|
|
183
147
|
} else {
|
|
184
148
|
var _visibilityAnimationC3, _visibilityAnimationC4;
|
|
185
|
-
|
|
186
149
|
setIsTabBarHidden(true);
|
|
187
150
|
const animation = (visibilityAnimationConfig === null || visibilityAnimationConfig === void 0 ? void 0 : (_visibilityAnimationC3 = visibilityAnimationConfig.hide) === null || _visibilityAnimationC3 === void 0 ? void 0 : _visibilityAnimationC3.animation) === 'spring' ? _reactNative.Animated.spring : _reactNative.Animated.timing;
|
|
188
151
|
animation(visible, {
|
|
@@ -192,15 +155,12 @@ function BottomTabBar(_ref3) {
|
|
|
192
155
|
...(visibilityAnimationConfig === null || visibilityAnimationConfig === void 0 ? void 0 : (_visibilityAnimationC4 = visibilityAnimationConfig.hide) === null || _visibilityAnimationC4 === void 0 ? void 0 : _visibilityAnimationC4.config)
|
|
193
156
|
}).start();
|
|
194
157
|
}
|
|
195
|
-
|
|
196
158
|
return () => visible.stopAnimation();
|
|
197
159
|
}, [visible, shouldShowTabBar]);
|
|
198
|
-
|
|
199
160
|
const [layout, setLayout] = _react.default.useState({
|
|
200
161
|
height: 0,
|
|
201
162
|
width: dimensions.width
|
|
202
163
|
});
|
|
203
|
-
|
|
204
164
|
const handleLayout = e => {
|
|
205
165
|
const {
|
|
206
166
|
height,
|
|
@@ -218,7 +178,6 @@ function BottomTabBar(_ref3) {
|
|
|
218
178
|
}
|
|
219
179
|
});
|
|
220
180
|
};
|
|
221
|
-
|
|
222
181
|
const {
|
|
223
182
|
routes
|
|
224
183
|
} = state;
|
|
@@ -266,22 +225,19 @@ function BottomTabBar(_ref3) {
|
|
|
266
225
|
accessibilityRole: "tablist",
|
|
267
226
|
style: styles.content
|
|
268
227
|
}, routes.map((route, index) => {
|
|
269
|
-
var _options$tabBarIcon;
|
|
270
|
-
|
|
271
228
|
const focused = index === state.index;
|
|
272
229
|
const {
|
|
273
230
|
options
|
|
274
231
|
} = descriptors[route.key];
|
|
275
|
-
|
|
276
232
|
const onPress = () => {
|
|
277
233
|
const event = navigation.emit({
|
|
278
234
|
type: 'tabPress',
|
|
279
235
|
target: route.key,
|
|
280
236
|
canPreventDefault: true
|
|
281
237
|
});
|
|
282
|
-
|
|
283
238
|
if (!focused && !event.defaultPrevented) {
|
|
284
|
-
navigation.dispatch({
|
|
239
|
+
navigation.dispatch({
|
|
240
|
+
..._native.CommonActions.navigate({
|
|
285
241
|
name: route.name,
|
|
286
242
|
merge: true
|
|
287
243
|
}),
|
|
@@ -289,14 +245,12 @@ function BottomTabBar(_ref3) {
|
|
|
289
245
|
});
|
|
290
246
|
}
|
|
291
247
|
};
|
|
292
|
-
|
|
293
248
|
const onLongPress = () => {
|
|
294
249
|
navigation.emit({
|
|
295
250
|
type: 'tabLongPress',
|
|
296
251
|
target: route.key
|
|
297
252
|
});
|
|
298
253
|
};
|
|
299
|
-
|
|
300
254
|
const label = options.tabBarLabel !== undefined ? options.tabBarLabel : options.title !== undefined ? options.title : route.name;
|
|
301
255
|
const accessibilityLabel = options.tabBarAccessibilityLabel !== undefined ? options.tabBarAccessibilityLabel : typeof label === 'string' && _reactNative.Platform.OS === 'ios' ? `${label}, tab, ${index + 1} of ${routes.length}` : undefined;
|
|
302
256
|
return /*#__PURE__*/_react.default.createElement(_native.NavigationContext.Provider, {
|
|
@@ -306,6 +260,7 @@ function BottomTabBar(_ref3) {
|
|
|
306
260
|
value: route
|
|
307
261
|
}, /*#__PURE__*/_react.default.createElement(_BottomTabItem.default, {
|
|
308
262
|
route: route,
|
|
263
|
+
descriptor: descriptors[route.key],
|
|
309
264
|
focused: focused,
|
|
310
265
|
horizontal: hasHorizontalLabels,
|
|
311
266
|
onPress: onPress,
|
|
@@ -319,7 +274,7 @@ function BottomTabBar(_ref3) {
|
|
|
319
274
|
activeBackgroundColor: tabBarActiveBackgroundColor,
|
|
320
275
|
inactiveBackgroundColor: tabBarInactiveBackgroundColor,
|
|
321
276
|
button: options.tabBarButton,
|
|
322
|
-
icon:
|
|
277
|
+
icon: options.tabBarIcon ?? (_ref5 => {
|
|
323
278
|
let {
|
|
324
279
|
color,
|
|
325
280
|
size
|
|
@@ -328,7 +283,7 @@ function BottomTabBar(_ref3) {
|
|
|
328
283
|
color: color,
|
|
329
284
|
size: size
|
|
330
285
|
});
|
|
331
|
-
},
|
|
286
|
+
}),
|
|
332
287
|
badge: options.tabBarBadge,
|
|
333
288
|
badgeStyle: options.tabBarBadgeStyle,
|
|
334
289
|
label: label,
|
|
@@ -339,7 +294,6 @@ function BottomTabBar(_ref3) {
|
|
|
339
294
|
})));
|
|
340
295
|
})));
|
|
341
296
|
}
|
|
342
|
-
|
|
343
297
|
const styles = _reactNative.StyleSheet.create({
|
|
344
298
|
tabBar: {
|
|
345
299
|
left: 0,
|