@evlop/native-components 1.0.153 → 1.0.154
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RenderTabs/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAA6B,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RenderTabs/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAA6B,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAOzE,UAAU,GAAI,SAAQ,KAAK;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,EAAE,CAAC;CACjB;AAED,UAAU,eAAe;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,qBAAqB,CAAC,EAAE,GAAG,CAAC;CAC/B;AAcD,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,eAAe,eA8DnE;AAgBD,eAAe,UAAU,CAAC"}
|
|
@@ -32,8 +32,13 @@ const react_native_1 = require("react-native");
|
|
|
32
32
|
const RenderBlocks_1 = __importDefault(require("../RenderBlocks"));
|
|
33
33
|
const commons_1 = require("@evlop/commons");
|
|
34
34
|
const native_1 = require("@react-navigation/native");
|
|
35
|
+
const View_1 = __importDefault(require("../View"));
|
|
36
|
+
const renderLazyPlaceholder = () => {
|
|
37
|
+
return (react_1.default.createElement(View_1.default, { p: "md" },
|
|
38
|
+
react_1.default.createElement(View_1.default, { width: "100%", height: "100%", backgroundColor: "gray-100", borderRadius: 10 })));
|
|
39
|
+
};
|
|
35
40
|
function RenderTabs({ tabs, animatedScrollPostion }) {
|
|
36
|
-
var _a, _b, _c
|
|
41
|
+
var _a, _b, _c;
|
|
37
42
|
const layout = (0, react_native_1.useWindowDimensions)();
|
|
38
43
|
const [index, setIndex] = (0, react_1.useState)(0);
|
|
39
44
|
const theme = (0, commons_1.useTheme)();
|
|
@@ -41,7 +46,6 @@ function RenderTabs({ tabs, animatedScrollPostion }) {
|
|
|
41
46
|
const tabIdFromParams = (_a = route.params) === null || _a === void 0 ? void 0 : _a.tab;
|
|
42
47
|
const tabBackgroundColor = (_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b['body-background'];
|
|
43
48
|
const tabTintColor = (_c = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _c === void 0 ? void 0 : _c['primary'];
|
|
44
|
-
const borderColor = (_d = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _d === void 0 ? void 0 : _d['gray-200'];
|
|
45
49
|
const routes = (0, react_1.useMemo)(() => tabs.map((tab) => ({ key: tab.id, title: tab.label, blocks: tab.blocks })), [tabs]);
|
|
46
50
|
// Watch for tab parameter changes
|
|
47
51
|
(0, react_1.useEffect)(() => {
|
|
@@ -59,8 +63,8 @@ function RenderTabs({ tabs, animatedScrollPostion }) {
|
|
|
59
63
|
const renderScene = ({ route }) => {
|
|
60
64
|
return (react_1.default.createElement(RenderBlocks_1.default, { blocks: route.blocks, animatedScrollPostion: animatedScrollPostion }));
|
|
61
65
|
};
|
|
62
|
-
const renderTabBar = (props) => (react_1.default.createElement(react_native_tab_view_1.TabBar, Object.assign({}, props, { scrollEnabled:
|
|
63
|
-
return (react_1.default.createElement(react_native_tab_view_1.TabView, { navigationState: { index, routes }, tabBarPosition: "top", lazy: true, renderScene: renderScene, onIndexChange: setIndex, initialLayout: { width: layout.width }, renderTabBar: renderTabBar }));
|
|
66
|
+
const renderTabBar = (props) => (react_1.default.createElement(react_native_tab_view_1.TabBar, Object.assign({}, props, { scrollEnabled: true, style: tabBarStyles.tabBar, labelStyle: tabBarStyles.label, indicatorStyle: tabBarStyles.indicator, activeColor: tabTintColor, inactiveColor: tabTintColor })));
|
|
67
|
+
return (react_1.default.createElement(react_native_tab_view_1.TabView, { navigationState: { index, routes }, tabBarPosition: "top", lazy: true, renderScene: renderScene, onIndexChange: setIndex, initialLayout: { width: layout.width }, renderTabBar: renderTabBar, renderLazyPlaceholder: renderLazyPlaceholder }));
|
|
64
68
|
}
|
|
65
69
|
const styles = react_native_1.StyleSheet.create({
|
|
66
70
|
tabBar: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/RenderTabs/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,iEAAyE;AACzE,+CAA+D;AAC/D,mEAA2C;AAC3C,4CAA0C;AAC1C,qDAAoD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/RenderTabs/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,iEAAyE;AACzE,+CAA+D;AAC/D,mEAA2C;AAC3C,4CAA0C;AAC1C,qDAAoD;AACpD,mDAA2B;AAiB3B,MAAM,qBAAqB,GAAG,GAAG,EAAE;IAC/B,OAAO,CACH,8BAAC,cAAI,IAAC,CAAC,EAAC,IAAI;QACR,8BAAC,cAAI,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,eAAe,EAAC,UAAU,EAAC,YAAY,EAAE,EAAS,GAAI,CACpF,CACV,CAAA;AACL,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAmB;;IAChE,MAAM,MAAM,GAAG,IAAA,kCAAmB,GAAE,CAAC;IACrC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,IAAA,kBAAQ,GAAE,CAAC;IACzB,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IAEzB,MAAM,eAAe,GAA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