@react-native-ohos/react-native-scrollable-tab-view 1.0.1-rc.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/README.md +112 -0
- package/lib/commonjs/Button.android.js +17 -0
- package/lib/commonjs/Button.android.js.map +1 -0
- package/lib/commonjs/Button.ios.js +13 -0
- package/lib/commonjs/Button.ios.js.map +1 -0
- package/lib/commonjs/DefaultTabBar.js +113 -0
- package/lib/commonjs/DefaultTabBar.js.map +1 -0
- package/lib/commonjs/SceneComponent.js +23 -0
- package/lib/commonjs/SceneComponent.js.map +1 -0
- package/lib/commonjs/ScrollableTabBar.js +258 -0
- package/lib/commonjs/ScrollableTabBar.js.map +1 -0
- package/lib/commonjs/StaticContainer.js +17 -0
- package/lib/commonjs/StaticContainer.js.map +1 -0
- package/lib/commonjs/index.js +419 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/react-native-scrollable-tab-view.iml +11 -0
- package/lib/module/Button.android.js +15 -0
- package/lib/module/Button.android.js.map +1 -0
- package/lib/module/Button.ios.js +11 -0
- package/lib/module/Button.ios.js.map +1 -0
- package/lib/module/DefaultTabBar.js +111 -0
- package/lib/module/DefaultTabBar.js.map +1 -0
- package/lib/module/SceneComponent.js +21 -0
- package/lib/module/SceneComponent.js.map +1 -0
- package/lib/module/ScrollableTabBar.js +256 -0
- package/lib/module/ScrollableTabBar.js.map +1 -0
- package/lib/module/StaticContainer.js +15 -0
- package/lib/module/StaticContainer.js.map +1 -0
- package/lib/module/index.js +417 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/react-native-scrollable-tab-view.iml +11 -0
- package/package.json +69 -0
- package/src/Button.android.js +18 -0
- package/src/Button.ios.js +14 -0
- package/src/DefaultTabBar.js +117 -0
- package/src/SceneComponent.js +17 -0
- package/src/ScrollableTabBar.js +252 -0
- package/src/StaticContainer.js +19 -0
- package/src/index.js +417 -0
- package/src/react-native-scrollable-tab-view.iml +11 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _reactNativePagerView = _interopRequireDefault(require("react-native-pager-view"));
|
|
4
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
5
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
6
|
+
const React = require('react');
|
|
7
|
+
const ReactNative = require('react-native');
|
|
8
|
+
const DeprecatedPropTypes = require('deprecated-react-native-prop-types');
|
|
9
|
+
const createReactClass = require('create-react-class');
|
|
10
|
+
const PropTypes = require('prop-types');
|
|
11
|
+
const {
|
|
12
|
+
Dimensions,
|
|
13
|
+
View,
|
|
14
|
+
Animated,
|
|
15
|
+
ScrollView,
|
|
16
|
+
Platform,
|
|
17
|
+
StyleSheet,
|
|
18
|
+
InteractionManager
|
|
19
|
+
} = ReactNative;
|
|
20
|
+
const TimerMixin = require('react-timer-mixin');
|
|
21
|
+
const SceneComponent = require('./SceneComponent');
|
|
22
|
+
const DefaultTabBar = require('./DefaultTabBar');
|
|
23
|
+
const ScrollableTabBar = require('./ScrollableTabBar');
|
|
24
|
+
const AnimatedViewPagerAndroid = Platform.OS === 'ios' ? undefined : Animated.createAnimatedComponent(_reactNativePagerView.default);
|
|
25
|
+
const ScrollableTabView = createReactClass({
|
|
26
|
+
displayName: "ScrollableTabView",
|
|
27
|
+
mixins: [TimerMixin],
|
|
28
|
+
statics: {
|
|
29
|
+
DefaultTabBar,
|
|
30
|
+
ScrollableTabBar
|
|
31
|
+
},
|
|
32
|
+
scrollOnMountCalled: false,
|
|
33
|
+
tabWillChangeWithoutGesture: false,
|
|
34
|
+
propTypes: {
|
|
35
|
+
tabBarPosition: PropTypes.oneOf(['top', 'bottom', 'overlayTop', 'overlayBottom']),
|
|
36
|
+
initialPage: PropTypes.number,
|
|
37
|
+
page: PropTypes.number,
|
|
38
|
+
onChangeTab: PropTypes.func,
|
|
39
|
+
onScroll: PropTypes.func,
|
|
40
|
+
renderTabBar: PropTypes.any,
|
|
41
|
+
tabBarUnderlineStyle: DeprecatedPropTypes.ViewPropTypes.style,
|
|
42
|
+
tabBarBackgroundColor: PropTypes.string,
|
|
43
|
+
tabBarActiveTextColor: PropTypes.string,
|
|
44
|
+
tabBarInactiveTextColor: PropTypes.string,
|
|
45
|
+
tabBarTextStyle: PropTypes.object,
|
|
46
|
+
style: DeprecatedPropTypes.ViewPropTypes.style,
|
|
47
|
+
contentProps: PropTypes.object,
|
|
48
|
+
scrollWithoutAnimation: PropTypes.bool,
|
|
49
|
+
locked: PropTypes.bool,
|
|
50
|
+
prerenderingSiblingsNumber: PropTypes.number
|
|
51
|
+
},
|
|
52
|
+
getDefaultProps() {
|
|
53
|
+
return {
|
|
54
|
+
tabBarPosition: 'top',
|
|
55
|
+
initialPage: 0,
|
|
56
|
+
page: -1,
|
|
57
|
+
onChangeTab: () => {},
|
|
58
|
+
onScroll: () => {},
|
|
59
|
+
contentProps: {},
|
|
60
|
+
scrollWithoutAnimation: false,
|
|
61
|
+
locked: false,
|
|
62
|
+
prerenderingSiblingsNumber: 0
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
getInitialState() {
|
|
66
|
+
const containerWidth = Dimensions.get('window').width;
|
|
67
|
+
let scrollValue;
|
|
68
|
+
let scrollXIOS;
|
|
69
|
+
let positionAndroid;
|
|
70
|
+
let offsetAndroid;
|
|
71
|
+
if (Platform.OS === 'ios') {
|
|
72
|
+
scrollXIOS = new Animated.Value(this.props.initialPage * containerWidth);
|
|
73
|
+
const containerWidthAnimatedValue = new Animated.Value(containerWidth);
|
|
74
|
+
// Need to call __makeNative manually to avoid a native animated bug. See
|
|
75
|
+
// https://github.com/facebook/react-native/pull/14435
|
|
76
|
+
containerWidthAnimatedValue.__makeNative();
|
|
77
|
+
scrollValue = Animated.divide(scrollXIOS, containerWidthAnimatedValue);
|
|
78
|
+
const callListeners = this._polyfillAnimatedValue(scrollValue);
|
|
79
|
+
scrollXIOS.addListener(({
|
|
80
|
+
value
|
|
81
|
+
}) => callListeners(value / this.state.containerWidth));
|
|
82
|
+
} else {
|
|
83
|
+
positionAndroid = new Animated.Value(this.props.initialPage);
|
|
84
|
+
offsetAndroid = new Animated.Value(0);
|
|
85
|
+
scrollValue = Animated.add(positionAndroid, offsetAndroid);
|
|
86
|
+
const callListeners = this._polyfillAnimatedValue(scrollValue);
|
|
87
|
+
let positionAndroidValue = this.props.initialPage;
|
|
88
|
+
let offsetAndroidValue = 0;
|
|
89
|
+
positionAndroid.addListener(({
|
|
90
|
+
value
|
|
91
|
+
}) => {
|
|
92
|
+
positionAndroidValue = value;
|
|
93
|
+
callListeners(positionAndroidValue + offsetAndroidValue);
|
|
94
|
+
});
|
|
95
|
+
offsetAndroid.addListener(({
|
|
96
|
+
value
|
|
97
|
+
}) => {
|
|
98
|
+
offsetAndroidValue = value;
|
|
99
|
+
callListeners(positionAndroidValue + offsetAndroidValue);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
currentPage: this.props.initialPage,
|
|
104
|
+
scrollValue,
|
|
105
|
+
scrollXIOS,
|
|
106
|
+
positionAndroid,
|
|
107
|
+
offsetAndroid,
|
|
108
|
+
containerWidth,
|
|
109
|
+
sceneKeys: this.newSceneKeys({
|
|
110
|
+
currentPage: this.props.initialPage
|
|
111
|
+
})
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
componentDidUpdate(prevProps) {
|
|
115
|
+
if (this.props.children !== prevProps.children) {
|
|
116
|
+
this.updateSceneKeys({
|
|
117
|
+
page: this.state.currentPage,
|
|
118
|
+
children: this.props.children
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (this.props.page >= 0 && this.props.page !== this.state.currentPage) {
|
|
122
|
+
this.goToPage(this.props.page);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
componentWillUnmount() {
|
|
126
|
+
if (Platform.OS === 'ios') {
|
|
127
|
+
this.state.scrollXIOS.removeAllListeners();
|
|
128
|
+
} else {
|
|
129
|
+
this.state.positionAndroid.removeAllListeners();
|
|
130
|
+
this.state.offsetAndroid.removeAllListeners();
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
goToPage(pageNumber) {
|
|
134
|
+
if (Platform.OS === 'ios') {
|
|
135
|
+
const offset = pageNumber * this.state.containerWidth;
|
|
136
|
+
if (this.scrollView) {
|
|
137
|
+
this.scrollView.scrollTo({
|
|
138
|
+
x: offset,
|
|
139
|
+
y: 0,
|
|
140
|
+
animated: !this.props.scrollWithoutAnimation
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
if (this.scrollView) {
|
|
145
|
+
this.tabWillChangeWithoutGesture = true;
|
|
146
|
+
if (this.props.scrollWithoutAnimation) {
|
|
147
|
+
this.scrollView.setPageWithoutAnimation(pageNumber);
|
|
148
|
+
} else {
|
|
149
|
+
this.scrollView.setPage(pageNumber);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const currentPage = this.state.currentPage;
|
|
154
|
+
this.updateSceneKeys({
|
|
155
|
+
page: pageNumber,
|
|
156
|
+
callback: this._onChangeTab.bind(this, currentPage, pageNumber)
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
renderTabBar(props) {
|
|
160
|
+
if (this.props.renderTabBar === false) {
|
|
161
|
+
return null;
|
|
162
|
+
} else if (this.props.renderTabBar) {
|
|
163
|
+
return React.cloneElement(this.props.renderTabBar(props), props);
|
|
164
|
+
} else {
|
|
165
|
+
return /*#__PURE__*/React.createElement(DefaultTabBar, props);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
updateSceneKeys({
|
|
169
|
+
page,
|
|
170
|
+
children = this.props.children,
|
|
171
|
+
callback = () => {}
|
|
172
|
+
}) {
|
|
173
|
+
let newKeys = this.newSceneKeys({
|
|
174
|
+
previousKeys: this.state.sceneKeys,
|
|
175
|
+
currentPage: page,
|
|
176
|
+
children
|
|
177
|
+
});
|
|
178
|
+
this.setState({
|
|
179
|
+
currentPage: page,
|
|
180
|
+
sceneKeys: newKeys
|
|
181
|
+
});
|
|
182
|
+
// fixed: 修复切换tab会闪烁的问题,callback中不依赖于最新的state,因此可以不用放在setState回调中
|
|
183
|
+
callback === null || callback === void 0 || callback();
|
|
184
|
+
},
|
|
185
|
+
newSceneKeys({
|
|
186
|
+
previousKeys = [],
|
|
187
|
+
currentPage = 0,
|
|
188
|
+
children = this.props.children
|
|
189
|
+
}) {
|
|
190
|
+
let newKeys = [];
|
|
191
|
+
this._children(children).forEach((child, idx) => {
|
|
192
|
+
let key = this._makeSceneKey(child, idx);
|
|
193
|
+
if (this._keyExists(previousKeys, key) || this._shouldRenderSceneKey(idx, currentPage)) {
|
|
194
|
+
newKeys.push(key);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return newKeys;
|
|
198
|
+
},
|
|
199
|
+
// Animated.add and Animated.divide do not currently support listeners so
|
|
200
|
+
// we have to polyfill it here since a lot of code depends on being able
|
|
201
|
+
// to add a listener to `scrollValue`. See https://github.com/facebook/react-native/pull/12620.
|
|
202
|
+
_polyfillAnimatedValue(animatedValue) {
|
|
203
|
+
const listeners = new Set();
|
|
204
|
+
const addListener = listener => {
|
|
205
|
+
listeners.add(listener);
|
|
206
|
+
};
|
|
207
|
+
const removeListener = listener => {
|
|
208
|
+
listeners.delete(listener);
|
|
209
|
+
};
|
|
210
|
+
const removeAllListeners = () => {
|
|
211
|
+
listeners.clear();
|
|
212
|
+
};
|
|
213
|
+
animatedValue.addListener = addListener;
|
|
214
|
+
animatedValue.removeListener = removeListener;
|
|
215
|
+
animatedValue.removeAllListeners = removeAllListeners;
|
|
216
|
+
return value => listeners.forEach(listener => listener({
|
|
217
|
+
value
|
|
218
|
+
}));
|
|
219
|
+
},
|
|
220
|
+
_shouldRenderSceneKey(idx, currentPageKey) {
|
|
221
|
+
let numOfSibling = this.props.prerenderingSiblingsNumber;
|
|
222
|
+
return idx < currentPageKey + numOfSibling + 1 && idx > currentPageKey - numOfSibling - 1;
|
|
223
|
+
},
|
|
224
|
+
_keyExists(sceneKeys, key) {
|
|
225
|
+
return sceneKeys.find(sceneKey => key === sceneKey);
|
|
226
|
+
},
|
|
227
|
+
_makeSceneKey(child, idx) {
|
|
228
|
+
return child.props.tabLabel + '_' + idx;
|
|
229
|
+
},
|
|
230
|
+
renderScrollableContent() {
|
|
231
|
+
if (Platform.OS === 'ios') {
|
|
232
|
+
const scenes = this._composeScenes();
|
|
233
|
+
return /*#__PURE__*/React.createElement(Animated.ScrollView, _extends({
|
|
234
|
+
horizontal: true,
|
|
235
|
+
pagingEnabled: true,
|
|
236
|
+
automaticallyAdjustContentInsets: false,
|
|
237
|
+
contentOffset: {
|
|
238
|
+
x: this.props.initialPage * this.state.containerWidth
|
|
239
|
+
},
|
|
240
|
+
ref: scrollView => {
|
|
241
|
+
this.scrollView = scrollView;
|
|
242
|
+
},
|
|
243
|
+
onScroll: Animated.event([{
|
|
244
|
+
nativeEvent: {
|
|
245
|
+
contentOffset: {
|
|
246
|
+
x: this.state.scrollXIOS
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}], {
|
|
250
|
+
useNativeDriver: false,
|
|
251
|
+
listener: this._onScroll
|
|
252
|
+
}),
|
|
253
|
+
onMomentumScrollBegin: this._onMomentumScrollBeginAndEnd,
|
|
254
|
+
onMomentumScrollEnd: this._onMomentumScrollBeginAndEnd,
|
|
255
|
+
scrollEventThrottle: 16,
|
|
256
|
+
scrollsToTop: false,
|
|
257
|
+
showsHorizontalScrollIndicator: false,
|
|
258
|
+
scrollEnabled: !this.props.locked,
|
|
259
|
+
directionalLockEnabled: true,
|
|
260
|
+
alwaysBounceVertical: false,
|
|
261
|
+
keyboardDismissMode: "on-drag"
|
|
262
|
+
}, this.props.contentProps), scenes);
|
|
263
|
+
} else {
|
|
264
|
+
const scenes = this._composeScenes();
|
|
265
|
+
return /*#__PURE__*/React.createElement(AnimatedViewPagerAndroid, _extends({
|
|
266
|
+
key: this._children().length,
|
|
267
|
+
style: styles.scrollableContentAndroid,
|
|
268
|
+
initialPage: this.props.initialPage,
|
|
269
|
+
onPageSelected: this._updateSelectedPage,
|
|
270
|
+
keyboardDismissMode: "on-drag",
|
|
271
|
+
scrollEnabled: !this.props.locked,
|
|
272
|
+
onPageScroll: Animated.event([{
|
|
273
|
+
nativeEvent: {
|
|
274
|
+
position: this.state.positionAndroid,
|
|
275
|
+
offset: this.state.offsetAndroid
|
|
276
|
+
}
|
|
277
|
+
}], {
|
|
278
|
+
useNativeDriver: false,
|
|
279
|
+
listener: this._onScroll
|
|
280
|
+
}),
|
|
281
|
+
ref: scrollView => {
|
|
282
|
+
this.scrollView = scrollView;
|
|
283
|
+
}
|
|
284
|
+
}, this.props.contentProps), scenes);
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
_composeScenes() {
|
|
288
|
+
return this._children().map((child, idx) => {
|
|
289
|
+
let key = this._makeSceneKey(child, idx);
|
|
290
|
+
return /*#__PURE__*/React.createElement(SceneComponent, {
|
|
291
|
+
key: child.key,
|
|
292
|
+
shouldUpdated: this._shouldRenderSceneKey(idx, this.state.currentPage),
|
|
293
|
+
style: {
|
|
294
|
+
width: this.state.containerWidth
|
|
295
|
+
}
|
|
296
|
+
}, this._keyExists(this.state.sceneKeys, key) ? child : /*#__PURE__*/React.createElement(View, {
|
|
297
|
+
tabLabel: child.props.tabLabel
|
|
298
|
+
}));
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
_onMomentumScrollBeginAndEnd(e) {
|
|
302
|
+
const offsetX = e.nativeEvent.contentOffset.x;
|
|
303
|
+
const page = Math.round(offsetX / this.state.containerWidth);
|
|
304
|
+
if (this.state.currentPage !== page) {
|
|
305
|
+
this._updateSelectedPage(page);
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
_updateSelectedPage(nextPage) {
|
|
309
|
+
let localNextPage = nextPage;
|
|
310
|
+
if (typeof localNextPage === 'object') {
|
|
311
|
+
localNextPage = nextPage.nativeEvent.position;
|
|
312
|
+
}
|
|
313
|
+
const currentPage = this.state.currentPage;
|
|
314
|
+
!this.tabWillChangeWithoutGesture && this.updateSceneKeys({
|
|
315
|
+
page: localNextPage,
|
|
316
|
+
callback: this._onChangeTab.bind(this, currentPage, localNextPage)
|
|
317
|
+
});
|
|
318
|
+
this.tabWillChangeWithoutGesture = false;
|
|
319
|
+
},
|
|
320
|
+
_onChangeTab(prevPage, currentPage) {
|
|
321
|
+
this.props.onChangeTab({
|
|
322
|
+
i: currentPage,
|
|
323
|
+
ref: this._children()[currentPage],
|
|
324
|
+
from: prevPage
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
_onScroll(e) {
|
|
328
|
+
if (Platform.OS === 'ios') {
|
|
329
|
+
const offsetX = e.nativeEvent.contentOffset.x;
|
|
330
|
+
if (offsetX === 0 && !this.scrollOnMountCalled) {
|
|
331
|
+
this.scrollOnMountCalled = true;
|
|
332
|
+
} else {
|
|
333
|
+
this.props.onScroll(offsetX / this.state.containerWidth);
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
const {
|
|
337
|
+
position,
|
|
338
|
+
offset
|
|
339
|
+
} = e.nativeEvent;
|
|
340
|
+
this.props.onScroll(position + offset);
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
_handleLayout(e) {
|
|
344
|
+
const {
|
|
345
|
+
width
|
|
346
|
+
} = e.nativeEvent.layout;
|
|
347
|
+
if (!width || width <= 0 || Math.round(width) === Math.round(this.state.containerWidth)) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (Platform.OS === 'ios') {
|
|
351
|
+
const containerWidthAnimatedValue = new Animated.Value(width);
|
|
352
|
+
// Need to call __makeNative manually to avoid a native animated bug. See
|
|
353
|
+
// https://github.com/facebook/react-native/pull/14435
|
|
354
|
+
containerWidthAnimatedValue.__makeNative();
|
|
355
|
+
scrollValue = Animated.divide(this.state.scrollXIOS, containerWidthAnimatedValue);
|
|
356
|
+
this.setState({
|
|
357
|
+
containerWidth: width,
|
|
358
|
+
scrollValue
|
|
359
|
+
});
|
|
360
|
+
} else {
|
|
361
|
+
this.setState({
|
|
362
|
+
containerWidth: width
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
this.requestAnimationFrame(() => {
|
|
366
|
+
this.goToPage(this.state.currentPage);
|
|
367
|
+
});
|
|
368
|
+
},
|
|
369
|
+
_children(children = this.props.children) {
|
|
370
|
+
return React.Children.map(children, child => child);
|
|
371
|
+
},
|
|
372
|
+
render() {
|
|
373
|
+
let overlayTabs = this.props.tabBarPosition === 'overlayTop' || this.props.tabBarPosition === 'overlayBottom';
|
|
374
|
+
let tabBarProps = {
|
|
375
|
+
goToPage: this.goToPage,
|
|
376
|
+
tabs: this._children().map(child => child.props.tabLabel),
|
|
377
|
+
activeTab: this.state.currentPage,
|
|
378
|
+
scrollValue: this.state.scrollValue,
|
|
379
|
+
containerWidth: this.state.containerWidth
|
|
380
|
+
};
|
|
381
|
+
if (this.props.tabBarBackgroundColor) {
|
|
382
|
+
tabBarProps.backgroundColor = this.props.tabBarBackgroundColor;
|
|
383
|
+
}
|
|
384
|
+
if (this.props.tabBarActiveTextColor) {
|
|
385
|
+
tabBarProps.activeTextColor = this.props.tabBarActiveTextColor;
|
|
386
|
+
}
|
|
387
|
+
if (this.props.tabBarInactiveTextColor) {
|
|
388
|
+
tabBarProps.inactiveTextColor = this.props.tabBarInactiveTextColor;
|
|
389
|
+
}
|
|
390
|
+
if (this.props.tabBarTextStyle) {
|
|
391
|
+
tabBarProps.textStyle = this.props.tabBarTextStyle;
|
|
392
|
+
}
|
|
393
|
+
if (this.props.tabBarUnderlineStyle) {
|
|
394
|
+
tabBarProps.underlineStyle = this.props.tabBarUnderlineStyle;
|
|
395
|
+
}
|
|
396
|
+
if (overlayTabs) {
|
|
397
|
+
tabBarProps.style = {
|
|
398
|
+
position: 'absolute',
|
|
399
|
+
left: 0,
|
|
400
|
+
right: 0,
|
|
401
|
+
[this.props.tabBarPosition === 'overlayTop' ? 'top' : 'bottom']: 0
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
405
|
+
style: [styles.container, this.props.style],
|
|
406
|
+
onLayout: this._handleLayout
|
|
407
|
+
}, this.props.tabBarPosition === 'top' && this.renderTabBar(tabBarProps), this.renderScrollableContent(), (this.props.tabBarPosition === 'bottom' || overlayTabs) && this.renderTabBar(tabBarProps));
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
module.exports = ScrollableTabView;
|
|
411
|
+
const styles = StyleSheet.create({
|
|
412
|
+
container: {
|
|
413
|
+
flex: 1
|
|
414
|
+
},
|
|
415
|
+
scrollableContentAndroid: {
|
|
416
|
+
flex: 1
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativePagerView","_interopRequireDefault","require","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","React","ReactNative","DeprecatedPropTypes","createReactClass","PropTypes","Dimensions","View","Animated","ScrollView","Platform","StyleSheet","InteractionManager","TimerMixin","SceneComponent","DefaultTabBar","ScrollableTabBar","AnimatedViewPagerAndroid","OS","undefined","createAnimatedComponent","ViewPager","ScrollableTabView","displayName","mixins","statics","scrollOnMountCalled","tabWillChangeWithoutGesture","propTypes","tabBarPosition","oneOf","initialPage","number","page","onChangeTab","func","onScroll","renderTabBar","any","tabBarUnderlineStyle","ViewPropTypes","style","tabBarBackgroundColor","string","tabBarActiveTextColor","tabBarInactiveTextColor","tabBarTextStyle","object","contentProps","scrollWithoutAnimation","bool","locked","prerenderingSiblingsNumber","getDefaultProps","getInitialState","containerWidth","get","width","scrollValue","scrollXIOS","positionAndroid","offsetAndroid","Value","props","containerWidthAnimatedValue","__makeNative","divide","callListeners","_polyfillAnimatedValue","addListener","value","state","add","positionAndroidValue","offsetAndroidValue","currentPage","sceneKeys","newSceneKeys","componentDidUpdate","prevProps","children","updateSceneKeys","goToPage","componentWillUnmount","removeAllListeners","pageNumber","offset","scrollView","scrollTo","x","y","animated","setPageWithoutAnimation","setPage","callback","_onChangeTab","cloneElement","createElement","newKeys","previousKeys","setState","_children","forEach","child","idx","key","_makeSceneKey","_keyExists","_shouldRenderSceneKey","push","animatedValue","listeners","Set","listener","removeListener","delete","clear","currentPageKey","numOfSibling","find","sceneKey","tabLabel","renderScrollableContent","scenes","_composeScenes","horizontal","pagingEnabled","automaticallyAdjustContentInsets","contentOffset","ref","event","nativeEvent","useNativeDriver","_onScroll","onMomentumScrollBegin","_onMomentumScrollBeginAndEnd","onMomentumScrollEnd","scrollEventThrottle","scrollsToTop","showsHorizontalScrollIndicator","scrollEnabled","directionalLockEnabled","alwaysBounceVertical","keyboardDismissMode","styles","scrollableContentAndroid","onPageSelected","_updateSelectedPage","onPageScroll","position","map","shouldUpdated","offsetX","Math","round","nextPage","localNextPage","prevPage","i","from","_handleLayout","layout","requestAnimationFrame","Children","render","overlayTabs","tabBarProps","tabs","activeTab","backgroundColor","activeTextColor","inactiveTextColor","textStyle","underlineStyle","left","right","container","onLayout","module","exports","create","flex"],"sourceRoot":"..\\..\\src","sources":["index.js"],"mappings":";;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,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AAI,CAAC7G,KAAK,CAACjB,eAAe;IACpD;IACA,IAAI,IAAI,CAACiB,KAAK,CAACxB,oBAAoB,EAAE;MACnC+H,WAAW,CAACO,cAAc,GAAG,IAAI,CAAC9G,KAAK,CAACxB,oBAAoB;IAC9D;IACA,IAAI8H,WAAW,EAAE;MACfC,WAAW,CAAC7H,KAAK,GAAG;QAClB4G,QAAQ,EAAE,UAAU;QACpByB,IAAI,EAAE,CAAC;QACPC,KAAK,EAAE,CAAC;QACR,CAAC,IAAI,CAAChH,KAAK,CAAClC,cAAc,KAAK,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG;MACnE,CAAC;IACH;IAEA,oBAAO5B,KAAA,CAAAgG,aAAA,CAAC1F,IAAI;MAACkC,KAAK,EAAE,CAACuG,MAAM,CAACgC,SAAS,EAAE,IAAI,CAACjH,KAAK,CAACtB,KAAK,CAAI;MAACwI,QAAQ,EAAE,IAAI,CAACjB;IAAc,GACtF,IAAI,CAACjG,KAAK,CAAClC,cAAc,KAAK,KAAK,IAAI,IAAI,CAACQ,YAAY,CAACiI,WAAW,CAAC,EACrE,IAAI,CAAC5C,uBAAuB,CAAC,CAAC,EAC9B,CAAC,IAAI,CAAC3D,KAAK,CAAClC,cAAc,KAAK,QAAQ,IAAIwI,WAAW,KAAK,IAAI,CAAChI,YAAY,CAACiI,WAAW,CACrF,CAAC;EACT;AACF,CAAC,CAAC;AAEFY,MAAM,CAACC,OAAO,GAAG7J,iBAAiB;AAElC,MAAM0H,MAAM,GAAGrI,UAAU,CAACyK,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE;EACR,CAAC;EACDpC,wBAAwB,EAAE;IACxBoC,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$">
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/Example/android/app/src/main/java" isTestSource="false" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="inheritedJdk" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
</module>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
const React = require('react');
|
|
3
|
+
const ReactNative = require('react-native');
|
|
4
|
+
const {
|
|
5
|
+
TouchableNativeFeedback,
|
|
6
|
+
View
|
|
7
|
+
} = ReactNative;
|
|
8
|
+
const Button = props => {
|
|
9
|
+
return /*#__PURE__*/React.createElement(TouchableNativeFeedback, _extends({
|
|
10
|
+
delayPressIn: 0,
|
|
11
|
+
background: TouchableNativeFeedback.SelectableBackground() // eslint-disable-line new-cap
|
|
12
|
+
}, props), props.children);
|
|
13
|
+
};
|
|
14
|
+
module.exports = Button;
|
|
15
|
+
//# sourceMappingURL=Button.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","require","ReactNative","TouchableNativeFeedback","View","Button","props","createElement","_extends","delayPressIn","background","SelectableBackground","children","module","exports"],"sourceRoot":"..\\..\\src","sources":["Button.android.js"],"mappings":";AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC;AAC9B,MAAMC,WAAW,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAM;EACJE,uBAAuB;EACvBC;AACF,CAAC,GAAGF,WAAW;AAEf,MAAMG,MAAM,GAAIC,KAAK,IAAK;EACxB,oBAAON,KAAA,CAAAO,aAAA,CAACJ,uBAAuB,EAAAK,QAAA;IAC7BC,YAAY,EAAE,CAAE;IAChBC,UAAU,EAAEP,uBAAuB,CAACQ,oBAAoB,CAAC,CAAE,CAAC;EAAA,GACxDL,KAAK,GAERA,KAAK,CAACM,QACgB,CAAC;AAC5B,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAGT,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const React = require('react');
|
|
2
|
+
const ReactNative = require('react-native');
|
|
3
|
+
const {
|
|
4
|
+
TouchableOpacity,
|
|
5
|
+
View
|
|
6
|
+
} = ReactNative;
|
|
7
|
+
const Button = props => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, props, props.children);
|
|
9
|
+
};
|
|
10
|
+
module.exports = Button;
|
|
11
|
+
//# sourceMappingURL=Button.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","require","ReactNative","TouchableOpacity","View","Button","props","createElement","children","module","exports"],"sourceRoot":"..\\..\\src","sources":["Button.ios.js"],"mappings":"AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC;AAC9B,MAAMC,WAAW,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAM;EACJE,gBAAgB;EAChBC;AACF,CAAC,GAAGF,WAAW;AAEf,MAAMG,MAAM,GAAIC,KAAK,IAAK;EACxB,oBAAON,KAAA,CAAAO,aAAA,CAACJ,gBAAgB,EAAKG,KAAK,EAC/BA,KAAK,CAACE,QACS,CAAC;AACrB,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAGL,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const React = require('react');
|
|
2
|
+
const ReactNative = require('react-native');
|
|
3
|
+
const DeprecatedPropTypes = require('deprecated-react-native-prop-types');
|
|
4
|
+
const PropTypes = require('prop-types');
|
|
5
|
+
const createReactClass = require('create-react-class');
|
|
6
|
+
const {
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text,
|
|
9
|
+
View,
|
|
10
|
+
Animated
|
|
11
|
+
} = ReactNative;
|
|
12
|
+
const Button = Platform.OS === 'ios' ? require('./Button.ios.js') : require('./Button.android.js');
|
|
13
|
+
const DefaultTabBar = createReactClass({
|
|
14
|
+
displayName: "DefaultTabBar",
|
|
15
|
+
propTypes: {
|
|
16
|
+
goToPage: PropTypes.func,
|
|
17
|
+
activeTab: PropTypes.number,
|
|
18
|
+
tabs: PropTypes.array,
|
|
19
|
+
backgroundColor: PropTypes.string,
|
|
20
|
+
activeTextColor: PropTypes.string,
|
|
21
|
+
inactiveTextColor: PropTypes.string,
|
|
22
|
+
textStyle: DeprecatedPropTypes.TextPropTypes.style,
|
|
23
|
+
tabStyle: DeprecatedPropTypes.ViewPropTypes.style,
|
|
24
|
+
renderTab: PropTypes.func,
|
|
25
|
+
underlineStyle: DeprecatedPropTypes.ViewPropTypes.style
|
|
26
|
+
},
|
|
27
|
+
getDefaultProps() {
|
|
28
|
+
return {
|
|
29
|
+
activeTextColor: 'navy',
|
|
30
|
+
inactiveTextColor: 'black',
|
|
31
|
+
backgroundColor: null
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
renderTabOption(name, page) {},
|
|
35
|
+
renderTab(name, page, isTabActive, onPressHandler) {
|
|
36
|
+
const {
|
|
37
|
+
activeTextColor,
|
|
38
|
+
inactiveTextColor,
|
|
39
|
+
textStyle
|
|
40
|
+
} = this.props;
|
|
41
|
+
const textColor = isTabActive ? activeTextColor : inactiveTextColor;
|
|
42
|
+
const fontWeight = isTabActive ? 'bold' : 'normal';
|
|
43
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
style: {
|
|
45
|
+
flex: 1
|
|
46
|
+
},
|
|
47
|
+
key: name,
|
|
48
|
+
accessible: true,
|
|
49
|
+
accessibilityLabel: name,
|
|
50
|
+
accessibilityTraits: "button",
|
|
51
|
+
onPress: () => onPressHandler(page)
|
|
52
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
53
|
+
style: [styles.tab, this.props.tabStyle]
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
55
|
+
style: [{
|
|
56
|
+
color: textColor,
|
|
57
|
+
fontWeight
|
|
58
|
+
}, textStyle]
|
|
59
|
+
}, name)));
|
|
60
|
+
},
|
|
61
|
+
render() {
|
|
62
|
+
const containerWidth = this.props.containerWidth;
|
|
63
|
+
const numberOfTabs = this.props.tabs.length;
|
|
64
|
+
const tabUnderlineStyle = {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
width: containerWidth / numberOfTabs,
|
|
67
|
+
height: 4,
|
|
68
|
+
backgroundColor: 'navy',
|
|
69
|
+
bottom: 0
|
|
70
|
+
};
|
|
71
|
+
const translateX = this.props.scrollValue.interpolate({
|
|
72
|
+
inputRange: [0, 1],
|
|
73
|
+
outputRange: [0, containerWidth / numberOfTabs]
|
|
74
|
+
});
|
|
75
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
76
|
+
style: [styles.tabs, {
|
|
77
|
+
backgroundColor: this.props.backgroundColor
|
|
78
|
+
}, this.props.style]
|
|
79
|
+
}, this.props.tabs.map((name, page) => {
|
|
80
|
+
const isTabActive = this.props.activeTab === page;
|
|
81
|
+
const renderTab = this.props.renderTab || this.renderTab;
|
|
82
|
+
return renderTab(name, page, isTabActive, this.props.goToPage);
|
|
83
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
84
|
+
style: [tabUnderlineStyle, {
|
|
85
|
+
transform: [{
|
|
86
|
+
translateX
|
|
87
|
+
}]
|
|
88
|
+
}, this.props.tabBarUnderlineStyle]
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const styles = StyleSheet.create({
|
|
93
|
+
tab: {
|
|
94
|
+
flex: 1,
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
paddingBottom: 10
|
|
98
|
+
},
|
|
99
|
+
tabs: {
|
|
100
|
+
height: 50,
|
|
101
|
+
flexDirection: 'row',
|
|
102
|
+
justifyContent: 'space-between',
|
|
103
|
+
borderWidth: 1,
|
|
104
|
+
borderTopWidth: 0,
|
|
105
|
+
borderLeftWidth: 0,
|
|
106
|
+
borderRightWidth: 0,
|
|
107
|
+
borderColor: '#ccc'
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
module.exports = DefaultTabBar;
|
|
111
|
+
//# sourceMappingURL=DefaultTabBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","require","ReactNative","DeprecatedPropTypes","PropTypes","createReactClass","StyleSheet","Text","View","Animated","Button","Platform","OS","DefaultTabBar","displayName","propTypes","goToPage","func","activeTab","number","tabs","array","backgroundColor","string","activeTextColor","inactiveTextColor","textStyle","TextPropTypes","style","tabStyle","ViewPropTypes","renderTab","underlineStyle","getDefaultProps","renderTabOption","name","page","isTabActive","onPressHandler","props","textColor","fontWeight","createElement","flex","key","accessible","accessibilityLabel","accessibilityTraits","onPress","styles","tab","color","render","containerWidth","numberOfTabs","length","tabUnderlineStyle","position","width","height","bottom","translateX","scrollValue","interpolate","inputRange","outputRange","map","transform","tabBarUnderlineStyle","create","alignItems","justifyContent","paddingBottom","flexDirection","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderColor","module","exports"],"sourceRoot":"..\\..\\src","sources":["DefaultTabBar.js"],"mappings":"AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC;AAC9B,MAAMC,WAAW,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAME,mBAAmB,GAAGF,OAAO,CAAC,oCAAoC,CAAC;AACzE,MAAMG,SAAS,GAAGH,OAAO,CAAC,YAAY,CAAC;AACvC,MAAMI,gBAAgB,GAAGJ,OAAO,CAAC,oBAAoB,CAAC;AACtD,MAAM;EACJK,UAAU;EACVC,IAAI;EACJC,IAAI;EACJC;AACF,CAAC,GAAGP,WAAW;AACf,MAAMQ,MA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,CAAC,CAAC/B,IAAI,EAAEC,IAAI,KAAK;MACnC,MAAMC,WAAW,GAAG,IAAI,CAACE,KAAK,CAACrB,SAAS,KAAKkB,IAAI;MACjD,MAAML,SAAS,GAAG,IAAI,CAACQ,KAAK,CAACR,SAAS,IAAI,IAAI,CAACA,SAAS;MACxD,OAAOA,SAAS,CAACI,IAAI,EAAEC,IAAI,EAAEC,WAAW,EAAE,IAAI,CAACE,KAAK,CAACvB,QAAQ,CAAC;IAChE,CAAC,CAAC,eACFhB,KAAA,CAAA0C,aAAA,CAACjC,QAAQ,CAACD,IAAI;MACZoB,KAAK,EAAE,CACL4B,iBAAiB,EACjB;QACEW,SAAS,EAAE,CACT;UAAEN;QAAW,CAAC;MAElB,CAAC,EACD,IAAI,CAACtB,KAAK,CAAC6B,oBAAoB;IAC/B,CACH,CACG,CAAC;EAEX;AACF,CAAC,CAAC;AAEF,MAAMnB,MAAM,GAAG3C,UAAU,CAAC+D,MAAM,CAAC;EAC/BnB,GAAG,EAAE;IACHP,IAAI,EAAE,CAAC;IACP2B,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,aAAa,EAAE;EACjB,CAAC;EACDpD,IAAI,EAAE;IACJuC,MAAM,EAAE,EAAE;IACVc,aAAa,EAAE,KAAK;IACpBF,cAAc,EAAE,eAAe;IAC/BG,WAAW,EAAE,CAAC;IACdC,cAAc,EAAE,CAAC;IACjBC,eAAe,EAAE,CAAC;IAClBC,gBAAgB,EAAE,CAAC;IACnBC,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEFC,MAAM,CAACC,OAAO,GAAGnE,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const React = require('react');
|
|
2
|
+
const ReactNative = require('react-native');
|
|
3
|
+
const {
|
|
4
|
+
Component
|
|
5
|
+
} = React;
|
|
6
|
+
const {
|
|
7
|
+
View,
|
|
8
|
+
StyleSheet
|
|
9
|
+
} = ReactNative;
|
|
10
|
+
const StaticContainer = require('./StaticContainer');
|
|
11
|
+
const SceneComponent = Props => {
|
|
12
|
+
const {
|
|
13
|
+
shouldUpdated,
|
|
14
|
+
...props
|
|
15
|
+
} = Props;
|
|
16
|
+
return /*#__PURE__*/React.createElement(View, props, /*#__PURE__*/React.createElement(StaticContainer, {
|
|
17
|
+
shouldUpdate: shouldUpdated
|
|
18
|
+
}, props.children));
|
|
19
|
+
};
|
|
20
|
+
module.exports = SceneComponent;
|
|
21
|
+
//# sourceMappingURL=SceneComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","require","ReactNative","Component","View","StyleSheet","StaticContainer","SceneComponent","Props","shouldUpdated","props","createElement","shouldUpdate","children","module","exports"],"sourceRoot":"..\\..\\src","sources":["SceneComponent.js"],"mappings":"AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC;AAC9B,MAAMC,WAAW,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAM;EAAEE;AAAU,CAAC,GAAGH,KAAK;AAC3B,MAAM;EAAEI,IAAI;EAAEC;AAAW,CAAC,GAAGH,WAAW;AAExC,MAAMI,eAAe,GAAGL,OAAO,CAAC,mBAAmB,CAAC;AAEpD,MAAMM,cAAc,GAAIC,KAAK,IAAK;EAChC,MAAM;IAAEC,aAAa;IAAE,GAAGC;EAAM,CAAC,GAAGF,KAAK;EACzC,oBAAOR,KAAA,CAAAW,aAAA,CAACP,IAAI,EAAKM,KAAK,eAClBV,KAAA,CAAAW,aAAA,CAACL,eAAe;IAACM,YAAY,EAAEH;EAAc,GAC1CC,KAAK,CAACG,QACQ,CACf,CAAC;AACT,CAAC;AAEDC,MAAM,CAACC,OAAO,GAAGR,cAAc","ignoreList":[]}
|