@dgui/react-native-material-bars-shared 1.3.0-beta.1 → 1.4.0-beta.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/dist/AppBar.d.ts +6 -2
- package/dist/AppBar.js +24 -5
- package/dist/AppBar.js.map +1 -1
- package/dist/DrawerBar.js +4 -2
- package/dist/DrawerBar.js.map +1 -1
- package/dist/DrawerToggle.js +1 -1
- package/dist/DrawerToggle.js.map +1 -1
- package/dist/TabBar.d.ts +9 -3
- package/dist/TabBar.js +23 -2
- package/dist/TabBar.js.map +1 -1
- package/dist/TabBarItem.d.ts +8 -0
- package/dist/TabBarItem.js +21 -0
- package/dist/TabBarItem.js.map +1 -0
- package/dist/Tabs.d.ts +4 -1
- package/dist/Tabs.js +29 -2
- package/dist/Tabs.js.map +1 -1
- package/package.json +12 -12
package/dist/AppBar.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { type FunctionComponent } from 'react';
|
|
1
|
+
import { type FunctionComponent, type PropsWithChildren } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
3
|
declare const AppBar: FunctionComponent<AppBarProps>;
|
|
3
4
|
export default AppBar;
|
|
4
|
-
export type AppBarProps = {
|
|
5
|
+
export type AppBarProps = PropsWithChildren<{
|
|
6
|
+
readonly appBarStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
readonly tabBarStyle?: StyleProp<ViewStyle>;
|
|
8
|
+
}>;
|
package/dist/AppBar.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -10,7 +21,7 @@ const react_shared_1 = require("@dgui/react-shared");
|
|
|
10
21
|
const react_1 = require("react");
|
|
11
22
|
const react_native_1 = require("react-native");
|
|
12
23
|
const styles = react_native_1.StyleSheet.create({
|
|
13
|
-
|
|
24
|
+
appBar: {
|
|
14
25
|
alignItems: 'center',
|
|
15
26
|
backgroundColor: '#CCC',
|
|
16
27
|
display: 'flex',
|
|
@@ -18,14 +29,22 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
18
29
|
flexDirection: 'row'
|
|
19
30
|
}
|
|
20
31
|
});
|
|
21
|
-
const AppBar = () => {
|
|
22
|
-
|
|
32
|
+
const AppBar = (_a) => {
|
|
33
|
+
var { appBarStyle: givenAppBarStyle, children, tabBarStyle } = _a, props = __rest(_a, ["appBarStyle", "children", "tabBarStyle"]);
|
|
34
|
+
const appBarStyle = (0, react_1.useMemo)(() => {
|
|
35
|
+
return Object.assign(Object.assign({}, styles.appBar), givenAppBarStyle);
|
|
36
|
+
}, [
|
|
37
|
+
givenAppBarStyle
|
|
38
|
+
]);
|
|
39
|
+
const selectTab = (0, react_shared_1.useSelectTab)();
|
|
40
|
+
const tabIndex = (0, react_shared_1.useTabIndex)();
|
|
23
41
|
const handleSelectTab = (0, react_1.useCallback)((index) => {
|
|
24
42
|
selectTab(index);
|
|
25
43
|
}, [
|
|
26
44
|
selectTab
|
|
27
45
|
]);
|
|
28
|
-
const
|
|
46
|
+
const tabOrder = (0, react_shared_1.useTabOrder)();
|
|
47
|
+
const tabs = (0, react_shared_1.useTabs)();
|
|
29
48
|
const routes = (0, react_1.useMemo)(() => {
|
|
30
49
|
return tabOrder.map((tabId) => {
|
|
31
50
|
var _a, _b, _c, _d;
|
|
@@ -40,7 +59,7 @@ const AppBar = () => {
|
|
|
40
59
|
tabOrder,
|
|
41
60
|
tabs
|
|
42
61
|
]);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style:
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: appBarStyle, children: [(0, jsx_runtime_1.jsx)(DrawerToggle_1.default, {}), (0, jsx_runtime_1.jsx)(Tabs_1.default, Object.assign({}, props, { defaultIndex: tabIndex, onSelectTab: handleSelectTab, routes: routes, style: tabBarStyle })), children] }));
|
|
44
63
|
};
|
|
45
64
|
exports.default = AppBar;
|
|
46
65
|
//# sourceMappingURL=AppBar.js.map
|
package/dist/AppBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBar.js","sourceRoot":"","sources":["../src/AppBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppBar.js","sourceRoot":"","sources":["../src/AppBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kEAA0C;AAC1C,kDACgB;AAChB,qDAK4B;AAC5B,iCAMe;AACf,+CAOsB;AAEtB,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE;QACP,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,MAAM;QAEvB,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,KAAK;KACpB;CACD,CAAC,CAAC;AAEH,MAAM,MAAM,GAAmC,CAAC,EAK/C,EAAE,EAAE;QAL2C,EAC/C,WAAW,EAAE,gBAAgB,EAC7B,QAAQ,EACR,WAAW,OAEX,EADG,KAAK,cAJuC,0CAK/C,CADQ;IAER,MAAM,WAAW,GAAyB,IAAA,eAAO,EAChD,GAAG,EAAE;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yleSheet.create({
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const DrawerBar = () => {
|
|
20
|
-
const
|
|
20
|
+
const drawerIndex = (0, react_shared_1.useDrawerIndex)();
|
|
21
|
+
const selectDrawer = (0, react_shared_1.useSelectDrawer)();
|
|
21
22
|
const handleSelectDrawer = (0, react_1.useCallback)((tabIndex) => {
|
|
22
23
|
selectDrawer(tabIndex);
|
|
23
24
|
}, [
|
|
24
25
|
selectDrawer
|
|
25
26
|
]);
|
|
26
|
-
const
|
|
27
|
+
const drawerOrder = (0, react_shared_1.useDrawerOrder)();
|
|
28
|
+
const drawers = (0, react_shared_1.useDrawers)();
|
|
27
29
|
const routes = (0, react_1.useMemo)(() => {
|
|
28
30
|
return drawerOrder.map((drawerId) => {
|
|
29
31
|
var _a, _b;
|
package/dist/DrawerBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerBar.js","sourceRoot":"","sources":["../src/DrawerBar.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"DrawerBar.js","sourceRoot":"","sources":["../src/DrawerBar.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qDAK4B;AAC5B,iCAIe;AACf,+CAIsB;AAEtB,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE;QACP,eAAe,EAAE,MAAM;QAEvB,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,CAAC;QACZ,aAAa,EAAE,KAAK;KACpB;CACD,CAAC,CAAC;AAEH,MAAM,SAAS,GAAsC,GAAG,EAAE;IACzD,MAAM,WAAW,GAAG,IAAA,6BAAc,GAAE,CAAC;IACrC,MAAM,YAAY,GAAG,IAAA,8BAAe,GAAE,CAAC;IAEvC,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EACrC,CACC,QAAgB,EACf,EAAE;QACH,YAAY,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC,EACD;QACC,YAAY;KACZ,CACD,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,6BAAc,GAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAA,yBAAU,GAAE,CAAC;IAE7B,MAAM,MAAM,GAAG,IAAA,eAAO,EACrB,GAAG,EAAE;QACJ,OAAO,WAAW,CAAC,GAAG,CACrB,CACC,QAAQ,EACP,EAAE;;YACH,OAAO,CACN;gBACC,GAAG,EAAE,QAAQ;gBACb,KAAK,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,CAAC,0CAAE,KAAK,mCAAI,QAAQ;aAC3C,CACD,CAAC;QACH,CAAC,CACD,CAAC;IACH,CAAC,EACD;QACC,WAAW;QACX,OAAO;KACP,CACD,CAAC;IAEF,OAAO,CACN,uBAAC,mBAAI,IACJ,KAAK,EAAE,MAAM,CAAC,MAAM,YAEpB,uBAAC,cAAI,IACJ,YAAY,EAAE,WAAW,EACzB,WAAW,EAAE,kBAAkB,EAC/B,MAAM,EAAE,MAAM,GACb,GACI,CACP,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
package/dist/DrawerToggle.js
CHANGED
|
@@ -11,7 +11,7 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
const DrawerToggle = () => {
|
|
14
|
-
const
|
|
14
|
+
const toggleDrawer = (0, react_shared_1.useDrawerToggle)();
|
|
15
15
|
const handlePress = (0, react_1.useCallback)(() => {
|
|
16
16
|
if (toggleDrawer) {
|
|
17
17
|
toggleDrawer();
|
package/dist/DrawerToggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerToggle.js","sourceRoot":"","sources":["../src/DrawerToggle.tsx"],"names":[],"mappings":";;;AAAA,qDAE4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"DrawerToggle.js","sourceRoot":"","sources":["../src/DrawerToggle.tsx"],"names":[],"mappings":";;;AAAA,qDAE4B;AAC5B,iCAIe;AACf,+CAGsB;AACtB,2DAE4B;AAE5B,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE;QACX,MAAM,EAAE,CAAC;KACT;CACD,CAAC,CAAC;AAEH,MAAM,YAAY,GAAyC,GAAG,EAAE;IAC/D,MAAM,YAAY,GAAG,IAAA,8BAAe,GAAE,CAAC;IAEvC,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC9B,GAAG,EAAE;QACJ,IAAI,YAAY,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;QAChB,CAAC;IACF,CAAC,EACD;QACC,YAAY;KACZ,CACD,CAAC;IAEF,OAAO,CACN,uBAAC,+BAAU,IACV,kBAAkB,EAAC,aAAa,EAChC,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,MAAM,CAAC,UAAU,GACvB,CACF,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,IAAA,YAAI,EAClB,YAAY,CACZ,CAAC"}
|
package/dist/TabBar.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type TabBarProps as AnnoyingTabBarProps } from 'react-native-tab-view';
|
|
3
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type NavigationState, type SceneRendererProps, type TabBarProps as AnnoyingTabBarProps } from 'react-native-tab-view';
|
|
3
|
+
export type RenderTabBar = (props: SceneRendererProps & {
|
|
4
|
+
navigationState: NavigationState<{
|
|
5
|
+
key: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}>;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
declare const TabBar: ({ indicatorStyle: parentIndicatorStyle, labelStyle: parentLabelStyle, style: parentStyle, tabStyle: parentTabStyle, ...props }: TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
10
|
export default TabBar;
|
|
5
11
|
export type TabBarProps = AnnoyingTabBarProps<any> & {};
|
package/dist/TabBar.js
CHANGED
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
const react_1 = require("react");
|
|
15
16
|
const react_native_1 = require("react-native");
|
|
16
17
|
const react_native_tab_view_1 = require("react-native-tab-view");
|
|
17
18
|
const styles = react_native_1.StyleSheet.create({
|
|
@@ -30,8 +31,28 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
30
31
|
}
|
|
31
32
|
});
|
|
32
33
|
const TabBar = (_a) => {
|
|
33
|
-
var props = __rest(_a, []);
|
|
34
|
-
|
|
34
|
+
var { indicatorStyle: parentIndicatorStyle, labelStyle: parentLabelStyle, style: parentStyle, tabStyle: parentTabStyle } = _a, props = __rest(_a, ["indicatorStyle", "labelStyle", "style", "tabStyle"]);
|
|
35
|
+
const style = (0, react_1.useMemo)(() => {
|
|
36
|
+
return Object.assign(Object.assign({}, styles.tabBar), parentStyle);
|
|
37
|
+
}, [
|
|
38
|
+
parentStyle
|
|
39
|
+
]);
|
|
40
|
+
const tabStyle = (0, react_1.useMemo)(() => {
|
|
41
|
+
return Object.assign(Object.assign({}, styles.tabBarTab), parentTabStyle);
|
|
42
|
+
}, [
|
|
43
|
+
parentTabStyle
|
|
44
|
+
]);
|
|
45
|
+
const indicatorStyle = (0, react_1.useMemo)(() => {
|
|
46
|
+
return Object.assign(Object.assign({}, styles.indicator), parentIndicatorStyle);
|
|
47
|
+
}, [
|
|
48
|
+
parentIndicatorStyle
|
|
49
|
+
]);
|
|
50
|
+
const labelStyle = (0, react_1.useMemo)(() => {
|
|
51
|
+
return Object.assign(Object.assign({}, styles.label), parentLabelStyle);
|
|
52
|
+
}, [
|
|
53
|
+
parentLabelStyle
|
|
54
|
+
]);
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(react_native_tab_view_1.TabBar, Object.assign({ bounces: true, indicatorStyle: indicatorStyle, labelStyle: labelStyle, pressColor: '#999', scrollEnabled: true, style: style, tabStyle: tabStyle }, props)));
|
|
35
56
|
};
|
|
36
57
|
exports.default = TabBar;
|
|
37
58
|
//# sourceMappingURL=TabBar.js.map
|
package/dist/TabBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../src/TabBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../src/TabBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,iCAGe;AACf,+CAKsB;AACtB,iEAK+B;AAE/B,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAChC,SAAS,EAAE;QACV,eAAe,EAAE,SAAS;KAC1B;IACD,KAAK,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,aAAa,EAAE,MAAM;KACrB;IACD,MAAM,EAAE;QACP,eAAe,EAAE,oBAAoB;KACrC;IACD,SAAS,EAAE;QACV,KAAK,EAAE,MAAM;KACb;CACD,CAAC,CAAC;AAWH,MAAM,MAAM,GAAG,CAAC,EAMF,EAAE,EAAE;QANF,EACf,cAAc,EAAE,oBAAoB,EACpC,UAAU,EAAE,gBAAgB,EAC5B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,cAAc,OAEX,EADV,KAAK,cALO,qDAMf,CADQ;IAER,MAAM,KAAK,GAAyB,IAAA,eAAO,EAC1C,GAAG,EAAE;QACJ,uCACI,MAAM,CAAC,MAAM,GAGb,WAAW,EACb;IACH,CAAC,EACD;QACC,WAAW;KACX,CACD,CAAC;IAEF,MAAM,QAAQ,GAAyB,IAAA,eAAO,EAC7C,GAAG,EAAE;QACJ,uCACI,MAAM,CAAC,SAAS,GAGhB,cAAc,EAChB;IACH,CAAC,EACD;QACC,cAAc;KACd,CACD,CAAC;IAEF,MAAM,cAAc,GAAyB,IAAA,eAAO,EACnD,GAAG,EAAE;QACJ,uCACI,MAAM,CAAC,SAAS,GAGhB,oBAAoB,EACtB;IACH,CAAC,EACD;QACC,oBAAoB;KACpB,CACD,CAAC;IAEF,MAAM,UAAU,GAAyB,IAAA,eAAO,EAC/C,GAAG,EAAE;QACJ,uCACI,MAAM,CAAC,KAAK,GAGZ,gBAAgB,EAClB;IACH,CAAC,EACD;QACC,gBAAgB;KAChB,CACD,CAAC;IAEF,OAAO,CACN,uBAAC,8BAAc,kBAGd,OAAO,QACP,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAC,MAAM,EACjB,aAAa,QACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,IACd,KAAK,EACR,CACF,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type JSXElementConstructor, type ReactElement } from 'react';
|
|
2
|
+
import { type TabBarItemProps as AnnoyingTabBarItemProps } from 'react-native-tab-view';
|
|
3
|
+
export type RenderTabBarItem = (props: AnnoyingTabBarItemProps<any> & {
|
|
4
|
+
key: string;
|
|
5
|
+
}) => ReactElement<any, string | JSXElementConstructor<any>>;
|
|
6
|
+
declare const TabBarItem: RenderTabBarItem;
|
|
7
|
+
export default TabBarItem;
|
|
8
|
+
export type TabBarProps = AnnoyingTabBarItemProps<any> & {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
const react_native_tab_view_1 = require("react-native-tab-view");
|
|
16
|
+
const TabBarItem = (_a) => {
|
|
17
|
+
var { key } = _a, props = __rest(_a, ["key"]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_native_tab_view_1.TabBarItem, Object.assign({}, props)));
|
|
19
|
+
};
|
|
20
|
+
exports.default = TabBarItem;
|
|
21
|
+
//# sourceMappingURL=TabBarItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabBarItem.js","sourceRoot":"","sources":["../src/TabBarItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAQA,iEAG+B;AAS/B,MAAM,UAAU,GAAqB,CAAC,EAIrC,EAAE,EAAE;QAJiC,EAErC,GAAG,OAEH,EADG,KAAK,cAH6B,OAIrC,CADQ;IAER,OAAO,CACN,uBAAC,kCAAkB,oBACd,KAAK,EACR,CACF,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
package/dist/Tabs.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { type RenderTabBarItem } from './TabBarItem';
|
|
1
2
|
import { type FunctionComponent } from 'react';
|
|
3
|
+
import { type TabBarProps as AnnoyingTabBarProps } from 'react-native-tab-view';
|
|
2
4
|
declare const Tabs: FunctionComponent<TabsProps>;
|
|
3
5
|
export default Tabs;
|
|
4
6
|
export type TabsProps = {
|
|
5
7
|
readonly defaultIndex: number;
|
|
6
8
|
readonly onSelectTab?: (tabIndex: number) => void;
|
|
9
|
+
readonly renderTabBarItem?: RenderTabBarItem;
|
|
7
10
|
readonly routes?: Array<{
|
|
8
11
|
key: string;
|
|
9
12
|
title: string;
|
|
10
13
|
}>;
|
|
11
|
-
}
|
|
14
|
+
} & Pick<AnnoyingTabBarProps<any>, 'style' | 'tabStyle' | 'indicatorStyle' | 'labelStyle'>;
|
package/dist/Tabs.js
CHANGED
|
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const renderScene_1 = __importDefault(require("./renderScene"));
|
|
8
8
|
const TabBar_1 = __importDefault(require("./TabBar"));
|
|
9
|
+
const TabBarItem_1 = __importDefault(require("./TabBarItem"));
|
|
9
10
|
const react_1 = require("react");
|
|
10
11
|
const react_native_tab_view_1 = require("react-native-tab-view");
|
|
11
|
-
const Tabs = ({ defaultIndex, onSelectTab, routes = [] }) => {
|
|
12
|
+
const Tabs = ({ defaultIndex, indicatorStyle, labelStyle, onSelectTab, renderTabBarItem: givenRenderTabBarItem, routes = [], style, tabStyle }) => {
|
|
12
13
|
const handleSelectTab = (0, react_1.useCallback)((tabIndex) => {
|
|
13
14
|
if (onSelectTab) {
|
|
14
15
|
onSelectTab(tabIndex);
|
|
@@ -33,7 +34,33 @@ const Tabs = ({ defaultIndex, onSelectTab, routes = [] }) => {
|
|
|
33
34
|
}, [
|
|
34
35
|
routes
|
|
35
36
|
]);
|
|
36
|
-
|
|
37
|
+
const renderTabBarItem = (0, react_1.useMemo)(() => {
|
|
38
|
+
const render = (props) => {
|
|
39
|
+
return givenRenderTabBarItem ?
|
|
40
|
+
givenRenderTabBarItem(props) :
|
|
41
|
+
(0, TabBarItem_1.default)(props);
|
|
42
|
+
};
|
|
43
|
+
return render;
|
|
44
|
+
}, [
|
|
45
|
+
givenRenderTabBarItem
|
|
46
|
+
]);
|
|
47
|
+
const renderTabBar = (0, react_1.useMemo)(() => {
|
|
48
|
+
const render = (props) => {
|
|
49
|
+
return (0, TabBar_1.default)(Object.assign({ indicatorStyle,
|
|
50
|
+
labelStyle,
|
|
51
|
+
renderTabBarItem,
|
|
52
|
+
style,
|
|
53
|
+
tabStyle }, props));
|
|
54
|
+
};
|
|
55
|
+
return render;
|
|
56
|
+
}, [
|
|
57
|
+
indicatorStyle,
|
|
58
|
+
labelStyle,
|
|
59
|
+
renderTabBarItem,
|
|
60
|
+
style,
|
|
61
|
+
tabStyle
|
|
62
|
+
]);
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(react_native_tab_view_1.TabView, { navigationState: navigationState, onIndexChange: handleSelectTab, renderScene: renderedScene, renderTabBar: renderTabBar }));
|
|
37
64
|
};
|
|
38
65
|
exports.default = Tabs;
|
|
39
66
|
//# sourceMappingURL=Tabs.js.map
|
package/dist/Tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../src/Tabs.tsx"],"names":[],"mappings":";;;;;;AAAA,gEAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../src/Tabs.tsx"],"names":[],"mappings":";;;;;;AAAA,gEAAwC;AACxC,sDAEkB;AAClB,8DAEsB;AACtB,iCAIe;AACf,iEAG+B;AAE/B,MAAM,IAAI,GAAiC,CAAC,EAC3C,YAAY,EACZ,cAAc,EACd,UAAU,EACV,WAAW,EACX,gBAAgB,EAAE,qBAAqB,EACvC,MAAM,GAAG,EAAE,EACX,KAAK,EACL,QAAQ,EACR,EAAE,EAAE;IACJ,MAAM,eAAe,GAAG,IAAA,mBAAW,EAClC,CACC,QAAgB,EACf,EAAE;QACH,IAAI,WAAW,EAAE,CAAC;YACjB,WAAW,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;IACF,CAAC,EACD;QACC,WAAW;KACX,CACD,CAAC;IAEF,MAAM,eAAe,GAAG,IAAA,eAAO,EAC9B,GAAG,EAAE;QAEJ,MAAM,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC3C,YAAY,CAAC,CAAC;YACd,MAAM,CAAC,MAAM,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GUI Shared Native Material Bars Shared Components",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.4.0-beta.1",
|
|
6
6
|
"private": false,
|
|
7
7
|
"description": "Shared Native Material Bars (AppBar & DrawerBar) components for @dgui",
|
|
8
8
|
"author": "wallzero @wallzeroblog (http://wallzero.com)",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"clean:dist": "rimraf dist"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@digest/eslint-config-jest": "^4.3
|
|
46
|
-
"@digest/eslint-config-react": "^4.3
|
|
47
|
-
"@digest/eslint-config-typescript": "^4.3
|
|
48
|
-
"@digest/jest-junit": "^4.3
|
|
49
|
-
"@digest/jest-react": "^4.3
|
|
50
|
-
"@digest/jest-typescript": "^4.3
|
|
51
|
-
"@digest/typescript": "^4.3
|
|
45
|
+
"@digest/eslint-config-jest": "^4.4.3",
|
|
46
|
+
"@digest/eslint-config-react": "^4.4.3",
|
|
47
|
+
"@digest/eslint-config-typescript": "^4.4.3",
|
|
48
|
+
"@digest/jest-junit": "^4.4.3",
|
|
49
|
+
"@digest/jest-react": "^4.4.3",
|
|
50
|
+
"@digest/jest-typescript": "^4.4.3",
|
|
51
|
+
"@digest/typescript": "^4.4.3",
|
|
52
52
|
"@types/jest": "^29.5.12",
|
|
53
|
-
"@types/react": "^18.3.
|
|
53
|
+
"@types/react": "^18.3.3",
|
|
54
54
|
"@types/react-test-renderer": "^18.3.0",
|
|
55
55
|
"cross-env": "^7.0.3",
|
|
56
56
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"react": "^18.3.1",
|
|
60
60
|
"react-native": "^0.74.1",
|
|
61
61
|
"react-native-paper": "^5.12.3",
|
|
62
|
-
"react-native-safe-area-context": "^4.10.
|
|
62
|
+
"react-native-safe-area-context": "^4.10.3",
|
|
63
63
|
"react-native-vector-icons": "^10.1.0",
|
|
64
64
|
"react-test-renderer": "^18.3.1",
|
|
65
65
|
"rimraf": "^5.0.7"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@dgui/react-shared": "^1.
|
|
68
|
+
"@dgui/react-shared": "^1.4.0-beta.1",
|
|
69
69
|
"react-native-tab-view": "^3.5.2"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"material",
|
|
86
86
|
"typescript"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "60bfb1f54146932cf13326666290ea9b8db03c44"
|
|
89
89
|
}
|