@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.
Files changed (40) hide show
  1. package/README.md +112 -0
  2. package/lib/commonjs/Button.android.js +17 -0
  3. package/lib/commonjs/Button.android.js.map +1 -0
  4. package/lib/commonjs/Button.ios.js +13 -0
  5. package/lib/commonjs/Button.ios.js.map +1 -0
  6. package/lib/commonjs/DefaultTabBar.js +113 -0
  7. package/lib/commonjs/DefaultTabBar.js.map +1 -0
  8. package/lib/commonjs/SceneComponent.js +23 -0
  9. package/lib/commonjs/SceneComponent.js.map +1 -0
  10. package/lib/commonjs/ScrollableTabBar.js +258 -0
  11. package/lib/commonjs/ScrollableTabBar.js.map +1 -0
  12. package/lib/commonjs/StaticContainer.js +17 -0
  13. package/lib/commonjs/StaticContainer.js.map +1 -0
  14. package/lib/commonjs/index.js +419 -0
  15. package/lib/commonjs/index.js.map +1 -0
  16. package/lib/commonjs/react-native-scrollable-tab-view.iml +11 -0
  17. package/lib/module/Button.android.js +15 -0
  18. package/lib/module/Button.android.js.map +1 -0
  19. package/lib/module/Button.ios.js +11 -0
  20. package/lib/module/Button.ios.js.map +1 -0
  21. package/lib/module/DefaultTabBar.js +111 -0
  22. package/lib/module/DefaultTabBar.js.map +1 -0
  23. package/lib/module/SceneComponent.js +21 -0
  24. package/lib/module/SceneComponent.js.map +1 -0
  25. package/lib/module/ScrollableTabBar.js +256 -0
  26. package/lib/module/ScrollableTabBar.js.map +1 -0
  27. package/lib/module/StaticContainer.js +15 -0
  28. package/lib/module/StaticContainer.js.map +1 -0
  29. package/lib/module/index.js +417 -0
  30. package/lib/module/index.js.map +1 -0
  31. package/lib/module/react-native-scrollable-tab-view.iml +11 -0
  32. package/package.json +69 -0
  33. package/src/Button.android.js +18 -0
  34. package/src/Button.ios.js +14 -0
  35. package/src/DefaultTabBar.js +117 -0
  36. package/src/SceneComponent.js +17 -0
  37. package/src/ScrollableTabBar.js +252 -0
  38. package/src/StaticContainer.js +19 -0
  39. package/src/index.js +417 -0
  40. package/src/react-native-scrollable-tab-view.iml +11 -0
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+
2
+ ## react-native-scrollable-tab-view
3
+ [![npm version](https://badge.fury.io/js/react-native-scrollable-tab-view.svg)](https://badge.fury.io/js/react-native-scrollable-tab-view)
4
+
5
+ This is probably my favorite navigation pattern on Android, I wish it
6
+ were more common on iOS! This is a very simple JavaScript-only
7
+ implementation of it for React Native. For more information about how
8
+ the animations behind this work, check out the Rebound section of the
9
+ [React Native Animation Guide](https://facebook.github.io/react-native/docs/animations.html)
10
+
11
+
12
+ ## Add it to your project
13
+
14
+ 1. Run `npm install react-native-scrollable-tab-view --save`
15
+ 2. `var ScrollableTabView = require('react-native-scrollable-tab-view');`
16
+
17
+ ## Demo
18
+ <a href="https://appetize.io/embed/6qfv7eydjtm34mhn6qwj2nt3xm?embed=true&screenOnly=false&xdocMsg=true&debug=true&scale=100&deviceColor=black&orientation=portrait&device=iphone6s&osVersion=9.3&deviceId=RGV2aWNlOjU2Y2FjNTExZWQwOTM2MTEwMGRhYTNlNg&platform=ios&width=375&height=668&phoneWidth=416&phoneHeight=870&screenOffsetLeft=21&screenOffsetTop=100&params=%7B%7D" target="_blank"><strong>Run this example</strong></a>
19
+
20
+ <a href="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo.gif"><img src="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo.gif" width="350"></a>
21
+ <a href="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo-fb.gif"><img src="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo-fb.gif" width="350"></a>
22
+
23
+ ## Basic usage
24
+
25
+ ```javascript
26
+ var ScrollableTabView = require('react-native-scrollable-tab-view');
27
+
28
+ var App = React.createClass({
29
+ render() {
30
+ return (
31
+ <ScrollableTabView>
32
+ <ReactPage tabLabel="React" />
33
+ <FlowPage tabLabel="Flow" />
34
+ <JestPage tabLabel="Jest" />
35
+ </ScrollableTabView>
36
+ );
37
+ }
38
+ });
39
+ ```
40
+
41
+ ## Injecting a custom tab bar
42
+
43
+ Suppose we had a custom tab bar called `CustomTabBar`, we would inject
44
+ it into our `ScrollableTabView` like this:
45
+
46
+ ```javascript
47
+ var ScrollableTabView = require('react-native-scrollable-tab-view');
48
+ var CustomTabBar = require('./CustomTabBar');
49
+
50
+ var App = React.createClass({
51
+ render() {
52
+ return (
53
+ <ScrollableTabView renderTabBar={() => <CustomTabBar someProp={'here'} />}>
54
+ <ReactPage tabLabel="React" />
55
+ <FlowPage tabLabel="Flow" />
56
+ <JestPage tabLabel="Jest" />
57
+ </ScrollableTabView>
58
+ );
59
+ }
60
+ });
61
+ ```
62
+ To start you can just copy [DefaultTabBar](https://github.com/skv-headless/react-native-scrollable-tab-view/blob/master/DefaultTabBar.js).
63
+
64
+ ## Examples
65
+
66
+ [SimpleExample](https://github.com/skv-headless/react-native-scrollable-tab-view/blob/master/Example/SimpleExample.js).
67
+
68
+ [ScrollableTabsExample](https://github.com/skv-headless/react-native-scrollable-tab-view/blob/master/Example/ScrollableTabsExample.js).
69
+
70
+ [OverlayExample](https://github.com/skv-headless/react-native-scrollable-tab-view/blob/master/Example/OverlayExample.js).
71
+
72
+ [FacebookExample](https://github.com/skv-headless/react-native-scrollable-tab-view/blob/master/Example/FacebookExample.js).
73
+
74
+ ## Props
75
+
76
+ - **`renderTabBar`** _(Function:ReactComponent)_ - accept 1 argument `props` and should return a component to use as
77
+ the tab bar. The component has `goToPage`, `tabs`, `activeTab` and
78
+ `ref` added to the props, and should implement `setAnimationValue` to
79
+ be able to animate itself along with the tab content. You can manually pass the `props` to the TabBar component.
80
+ - **`tabBarPosition`** _(String)_ Defaults to `"top"`.
81
+ - `"bottom"` to position the tab bar below content.
82
+ - `"overlayTop"` or `"overlayBottom"` for a semitransparent tab bar that overlays content. Custom tab bars must consume a style prop on their outer element to support this feature: `style={this.props.style}`.
83
+ - **`onChangeTab`** _(Function)_ - function to call when tab changes, should accept 1 argument which is an Object containing two keys: `i`: the index of the tab that is selected, `ref`: the ref of the tab that is selected
84
+ - **`onScroll`** _(Function)_ - function to call when the pages are sliding, should accept 1 argument which is an Float number representing the page position in the slide frame.
85
+ - **`locked`** _(Bool)_ - disables horizontal dragging to scroll between tabs, default is false.
86
+ - **`initialPage`** _(Integer)_ - the index of the initially selected tab, defaults to 0 === first tab.
87
+ - **`page`** _(Integer)_ - set selected tab(can be buggy see [#126](https://github.com/brentvatne/react-native-scrollable-tab-view/issues/126)
88
+ - **`children`** _(ReactComponents)_ - each top-level child component should have a `tabLabel` prop that can be used by the tab bar component to render out the labels. The default tab bar expects it to be a string, but you can use anything you want if you make a custom tab bar.
89
+ - **`tabBarUnderlineStyle`** _([View.propTypes.style](https://facebook.github.io/react-native/docs/view.html#style))_ - style of the default tab bar's underline.
90
+ - **`tabBarBackgroundColor`** _(String)_ - color of the default tab bar's background, defaults to `white`
91
+ - **`tabBarActiveTextColor`** _(String)_ - color of the default tab bar's text when active, defaults to `navy`
92
+ - **`tabBarInactiveTextColor`** _(String)_ - color of the default tab bar's text when inactive, defaults to `black`
93
+ - **`tabBarTextStyle`** _(Object)_ - Additional styles to the tab bar's text. Example: `{fontFamily: 'Roboto', fontSize: 15}`
94
+ - **`style`** _([View.propTypes.style](https://facebook.github.io/react-native/docs/view.html#style))_
95
+ - **`contentProps`** _(Object)_ - props that are applied to root `ScrollView`/`ViewPagerAndroid`. Note that overriding defaults set by the library may break functionality; see the source for details.
96
+ - **`scrollWithoutAnimation`** _(Bool)_ - on tab press change tab without animation.
97
+ - **`prerenderingSiblingsNumber`** _(Integer)_ - pre-render nearby # sibling, `Infinity` === render all the siblings, default to 0 === render current page.
98
+
99
+ ## Contribution
100
+ **Issues** are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.
101
+
102
+ **Pull requests** are welcome. If you want to change API or making something big better to create issue and discuss it first. Before submiting PR please run ```eslint .``` Also all eslint fixes are welcome.
103
+
104
+ Please attach video or gif to PR's and issues it is super helpful.
105
+
106
+ <a href="http://www.abeautifulsite.net/recording-a-screencast-with-quicktime/" target="_blank">How to make video</a>
107
+
108
+ <a href="https://github.com/jclem/gifify" target="_blank">How to make gif from video</a>
109
+
110
+ ---
111
+
112
+ **MIT Licensed**
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ const React = require('react');
5
+ const ReactNative = require('react-native');
6
+ const {
7
+ TouchableNativeFeedback,
8
+ View
9
+ } = ReactNative;
10
+ const Button = props => {
11
+ return /*#__PURE__*/React.createElement(TouchableNativeFeedback, _extends({
12
+ delayPressIn: 0,
13
+ background: TouchableNativeFeedback.SelectableBackground() // eslint-disable-line new-cap
14
+ }, props), props.children);
15
+ };
16
+ module.exports = Button;
17
+ //# 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,13 @@
1
+ "use strict";
2
+
3
+ const React = require('react');
4
+ const ReactNative = require('react-native');
5
+ const {
6
+ TouchableOpacity,
7
+ View
8
+ } = ReactNative;
9
+ const Button = props => {
10
+ return /*#__PURE__*/React.createElement(TouchableOpacity, props, props.children);
11
+ };
12
+ module.exports = Button;
13
+ //# 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,113 @@
1
+ "use strict";
2
+
3
+ const React = require('react');
4
+ const ReactNative = require('react-native');
5
+ const DeprecatedPropTypes = require('deprecated-react-native-prop-types');
6
+ const PropTypes = require('prop-types');
7
+ const createReactClass = require('create-react-class');
8
+ const {
9
+ StyleSheet,
10
+ Text,
11
+ View,
12
+ Animated
13
+ } = ReactNative;
14
+ const Button = Platform.OS === 'ios' ? require('./Button.ios.js') : require('./Button.android.js');
15
+ const DefaultTabBar = createReactClass({
16
+ displayName: "DefaultTabBar",
17
+ propTypes: {
18
+ goToPage: PropTypes.func,
19
+ activeTab: PropTypes.number,
20
+ tabs: PropTypes.array,
21
+ backgroundColor: PropTypes.string,
22
+ activeTextColor: PropTypes.string,
23
+ inactiveTextColor: PropTypes.string,
24
+ textStyle: DeprecatedPropTypes.TextPropTypes.style,
25
+ tabStyle: DeprecatedPropTypes.ViewPropTypes.style,
26
+ renderTab: PropTypes.func,
27
+ underlineStyle: DeprecatedPropTypes.ViewPropTypes.style
28
+ },
29
+ getDefaultProps() {
30
+ return {
31
+ activeTextColor: 'navy',
32
+ inactiveTextColor: 'black',
33
+ backgroundColor: null
34
+ };
35
+ },
36
+ renderTabOption(name, page) {},
37
+ renderTab(name, page, isTabActive, onPressHandler) {
38
+ const {
39
+ activeTextColor,
40
+ inactiveTextColor,
41
+ textStyle
42
+ } = this.props;
43
+ const textColor = isTabActive ? activeTextColor : inactiveTextColor;
44
+ const fontWeight = isTabActive ? 'bold' : 'normal';
45
+ return /*#__PURE__*/React.createElement(Button, {
46
+ style: {
47
+ flex: 1
48
+ },
49
+ key: name,
50
+ accessible: true,
51
+ accessibilityLabel: name,
52
+ accessibilityTraits: "button",
53
+ onPress: () => onPressHandler(page)
54
+ }, /*#__PURE__*/React.createElement(View, {
55
+ style: [styles.tab, this.props.tabStyle]
56
+ }, /*#__PURE__*/React.createElement(Text, {
57
+ style: [{
58
+ color: textColor,
59
+ fontWeight
60
+ }, textStyle]
61
+ }, name)));
62
+ },
63
+ render() {
64
+ const containerWidth = this.props.containerWidth;
65
+ const numberOfTabs = this.props.tabs.length;
66
+ const tabUnderlineStyle = {
67
+ position: 'absolute',
68
+ width: containerWidth / numberOfTabs,
69
+ height: 4,
70
+ backgroundColor: 'navy',
71
+ bottom: 0
72
+ };
73
+ const translateX = this.props.scrollValue.interpolate({
74
+ inputRange: [0, 1],
75
+ outputRange: [0, containerWidth / numberOfTabs]
76
+ });
77
+ return /*#__PURE__*/React.createElement(View, {
78
+ style: [styles.tabs, {
79
+ backgroundColor: this.props.backgroundColor
80
+ }, this.props.style]
81
+ }, this.props.tabs.map((name, page) => {
82
+ const isTabActive = this.props.activeTab === page;
83
+ const renderTab = this.props.renderTab || this.renderTab;
84
+ return renderTab(name, page, isTabActive, this.props.goToPage);
85
+ }), /*#__PURE__*/React.createElement(Animated.View, {
86
+ style: [tabUnderlineStyle, {
87
+ transform: [{
88
+ translateX
89
+ }]
90
+ }, this.props.tabBarUnderlineStyle]
91
+ }));
92
+ }
93
+ });
94
+ const styles = StyleSheet.create({
95
+ tab: {
96
+ flex: 1,
97
+ alignItems: 'center',
98
+ justifyContent: 'center',
99
+ paddingBottom: 10
100
+ },
101
+ tabs: {
102
+ height: 50,
103
+ flexDirection: 'row',
104
+ justifyContent: 'space-between',
105
+ borderWidth: 1,
106
+ borderTopWidth: 0,
107
+ borderLeftWidth: 0,
108
+ borderRightWidth: 0,
109
+ borderColor: '#ccc'
110
+ }
111
+ });
112
+ module.exports = DefaultTabBar;
113
+ //# 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,cA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AAC;AAEFC,MAAM,CAACC,OAAO,GAAGnE,aAAa","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ const React = require('react');
4
+ const ReactNative = require('react-native');
5
+ const {
6
+ Component
7
+ } = React;
8
+ const {
9
+ View,
10
+ StyleSheet
11
+ } = ReactNative;
12
+ const StaticContainer = require('./StaticContainer');
13
+ const SceneComponent = Props => {
14
+ const {
15
+ shouldUpdated,
16
+ ...props
17
+ } = Props;
18
+ return /*#__PURE__*/React.createElement(View, props, /*#__PURE__*/React.createElement(StaticContainer, {
19
+ shouldUpdate: shouldUpdated
20
+ }, props.children));
21
+ };
22
+ module.exports = SceneComponent;
23
+ //# 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":[]}
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+
3
+ const React = require('react');
4
+ const ReactNative = require('react-native');
5
+ const DeprecatedPropTypes = require('deprecated-react-native-prop-types');
6
+ const PropTypes = require('prop-types');
7
+ const createReactClass = require('create-react-class');
8
+ const {
9
+ View,
10
+ Animated,
11
+ StyleSheet,
12
+ ScrollView,
13
+ Text,
14
+ Platform,
15
+ Dimensions
16
+ } = ReactNative;
17
+ const Button = Platform.OS === 'ios' ? require('./Button.ios.js') : require('./Button.android.js');
18
+ const WINDOW_WIDTH = Dimensions.get('window').width;
19
+ const ScrollableTabBar = createReactClass({
20
+ displayName: "ScrollableTabBar",
21
+ propTypes: {
22
+ goToPage: PropTypes.func,
23
+ activeTab: PropTypes.number,
24
+ tabs: PropTypes.array,
25
+ backgroundColor: PropTypes.string,
26
+ activeTextColor: PropTypes.string,
27
+ inactiveTextColor: PropTypes.string,
28
+ scrollOffset: PropTypes.number,
29
+ style: DeprecatedPropTypes.ViewPropTypes.style,
30
+ tabStyle: DeprecatedPropTypes.ViewPropTypes.style,
31
+ tabsContainerStyle: DeprecatedPropTypes.ViewPropTypes.style,
32
+ textStyle: DeprecatedPropTypes.TextPropTypes.style,
33
+ renderTab: PropTypes.func,
34
+ underlineStyle: DeprecatedPropTypes.ViewPropTypes.style,
35
+ onScroll: PropTypes.func
36
+ },
37
+ getDefaultProps() {
38
+ return {
39
+ scrollOffset: 52,
40
+ activeTextColor: 'navy',
41
+ inactiveTextColor: 'black',
42
+ backgroundColor: null,
43
+ style: {},
44
+ tabStyle: {},
45
+ tabsContainerStyle: {},
46
+ underlineStyle: {}
47
+ };
48
+ },
49
+ getInitialState() {
50
+ this._tabsMeasurements = [];
51
+ return {
52
+ _leftTabUnderline: new Animated.Value(0),
53
+ _widthTabUnderline: new Animated.Value(0),
54
+ _containerWidth: null
55
+ };
56
+ },
57
+ componentDidMount() {
58
+ this.props.scrollValue.addListener(this.updateView);
59
+ },
60
+ updateView(offset) {
61
+ const position = Math.floor(offset.value);
62
+ const pageOffset = offset.value % 1;
63
+ const tabCount = this.props.tabs.length;
64
+ const lastTabPosition = tabCount - 1;
65
+ if (tabCount === 0 || offset.value < 0 || offset.value > lastTabPosition) {
66
+ return;
67
+ }
68
+ if (this.necessarilyMeasurementsCompleted(position, position === lastTabPosition)) {
69
+ this.updateTabPanel(position, pageOffset);
70
+ this.updateTabUnderline(position, pageOffset, tabCount);
71
+ }
72
+ },
73
+ necessarilyMeasurementsCompleted(position, isLastTab) {
74
+ return this._tabsMeasurements[position] && (isLastTab || this._tabsMeasurements[position + 1]) && this._tabContainerMeasurements && this._containerMeasurements;
75
+ },
76
+ updateTabPanel(position, pageOffset) {
77
+ const containerWidth = this._containerMeasurements.width;
78
+ const tabWidth = this._tabsMeasurements[position].width;
79
+ const nextTabMeasurements = this._tabsMeasurements[position + 1];
80
+ const nextTabWidth = nextTabMeasurements && nextTabMeasurements.width || 0;
81
+ const tabOffset = this._tabsMeasurements[position].left;
82
+ const absolutePageOffset = pageOffset * tabWidth;
83
+ let newScrollX = tabOffset + absolutePageOffset;
84
+
85
+ // center tab and smooth tab change (for when tabWidth changes a lot between two tabs)
86
+ newScrollX -= (containerWidth - (1 - pageOffset) * tabWidth - pageOffset * nextTabWidth) / 2;
87
+ newScrollX = newScrollX >= 0 ? newScrollX : 0;
88
+ if (Platform.OS === 'android') {
89
+ const rightBoundScroll = this._tabContainerMeasurements.width - this._containerMeasurements.width;
90
+ newScrollX = newScrollX > rightBoundScroll ? rightBoundScroll : newScrollX;
91
+ if (this._scrollView) {
92
+ this._scrollView.scrollTo({
93
+ x: newScrollX,
94
+ y: 0,
95
+ animated: false
96
+ });
97
+ }
98
+ } else {
99
+ if (this._scrollView) {
100
+ this._scrollView.scrollTo({
101
+ x: newScrollX,
102
+ y: 0,
103
+ animated: false
104
+ });
105
+ }
106
+ }
107
+ },
108
+ updateTabUnderline(position, pageOffset, tabCount) {
109
+ const lineLeft = this._tabsMeasurements[position].left;
110
+ const lineRight = this._tabsMeasurements[position].right;
111
+ if (position < tabCount - 1) {
112
+ const nextTabLeft = this._tabsMeasurements[position + 1].left;
113
+ const nextTabRight = this._tabsMeasurements[position + 1].right;
114
+ const newLineLeft = pageOffset * nextTabLeft + (1 - pageOffset) * lineLeft;
115
+ const newLineRight = pageOffset * nextTabRight + (1 - pageOffset) * lineRight;
116
+ this.state._leftTabUnderline.setValue(newLineLeft);
117
+ this.state._widthTabUnderline.setValue(newLineRight - newLineLeft);
118
+ } else {
119
+ this.state._leftTabUnderline.setValue(lineLeft);
120
+ this.state._widthTabUnderline.setValue(lineRight - lineLeft);
121
+ }
122
+ },
123
+ renderTab(name, page, isTabActive, onPressHandler, onLayoutHandler) {
124
+ const {
125
+ activeTextColor,
126
+ inactiveTextColor,
127
+ textStyle
128
+ } = this.props;
129
+ const textColor = isTabActive ? activeTextColor : inactiveTextColor;
130
+ const fontWeight = isTabActive ? 'bold' : 'normal';
131
+ return /*#__PURE__*/React.createElement(Button, {
132
+ key: `${name}_${page}`,
133
+ accessible: true,
134
+ accessibilityLabel: name,
135
+ accessibilityTraits: "button",
136
+ onPress: () => onPressHandler(page),
137
+ onLayout: onLayoutHandler
138
+ }, /*#__PURE__*/React.createElement(View, {
139
+ style: [styles.tab, this.props.tabStyle]
140
+ }, /*#__PURE__*/React.createElement(Text, {
141
+ style: [{
142
+ color: textColor,
143
+ fontWeight
144
+ }, textStyle]
145
+ }, name)));
146
+ },
147
+ measureTab(page, event) {
148
+ const {
149
+ x,
150
+ width,
151
+ height
152
+ } = event.nativeEvent.layout;
153
+ this._tabsMeasurements[page] = {
154
+ left: x,
155
+ right: x + width,
156
+ width,
157
+ height
158
+ };
159
+ this.updateView({
160
+ value: this.props.scrollValue.__getValue()
161
+ });
162
+ },
163
+ render() {
164
+ const tabUnderlineStyle = {
165
+ position: 'absolute',
166
+ height: 4,
167
+ backgroundColor: 'navy',
168
+ bottom: 0
169
+ };
170
+ const dynamicTabUnderline = {
171
+ left: this.state._leftTabUnderline,
172
+ width: this.state._widthTabUnderline
173
+ };
174
+ const {
175
+ onScroll
176
+ } = this.props;
177
+ return /*#__PURE__*/React.createElement(View, {
178
+ style: [styles.container, {
179
+ backgroundColor: this.props.backgroundColor
180
+ }, this.props.style],
181
+ onLayout: this.onContainerLayout
182
+ }, /*#__PURE__*/React.createElement(ScrollView, {
183
+ ref: scrollView => {
184
+ this._scrollView = scrollView;
185
+ },
186
+ horizontal: true,
187
+ showsHorizontalScrollIndicator: false,
188
+ showsVerticalScrollIndicator: false,
189
+ directionalLockEnabled: true,
190
+ bounces: false,
191
+ scrollsToTop: false,
192
+ onScroll: onScroll,
193
+ scrollEventThrottle: 16
194
+ }, /*#__PURE__*/React.createElement(View, {
195
+ style: [styles.tabs, {
196
+ width: this.state._containerWidth
197
+ }, this.props.tabsContainerStyle],
198
+ ref: 'tabContainer',
199
+ onLayout: this.onTabContainerLayout
200
+ }, this.props.tabs.map((name, page) => {
201
+ const isTabActive = this.props.activeTab === page;
202
+ const renderTab = this.props.renderTab || this.renderTab;
203
+ return renderTab(name, page, isTabActive, this.props.goToPage, this.measureTab.bind(this, page));
204
+ }), /*#__PURE__*/React.createElement(Animated.View, {
205
+ style: [tabUnderlineStyle, dynamicTabUnderline, this.props.underlineStyle]
206
+ }))));
207
+ },
208
+ componentDidUpdate(prevProps) {
209
+ // If the tabs change, force the width of the tabs container to be recalculated
210
+ if (JSON.stringify(prevProps.tabs) !== JSON.stringify(this.props.tabs) && this.state._containerWidth) {
211
+ this.setState({
212
+ _containerWidth: null
213
+ });
214
+ }
215
+ },
216
+ onTabContainerLayout(e) {
217
+ this._tabContainerMeasurements = e.nativeEvent.layout;
218
+ let width = this._tabContainerMeasurements.width;
219
+ if (width < WINDOW_WIDTH) {
220
+ width = WINDOW_WIDTH;
221
+ }
222
+ this.setState({
223
+ _containerWidth: width
224
+ });
225
+ this.updateView({
226
+ value: this.props.scrollValue.__getValue()
227
+ });
228
+ },
229
+ onContainerLayout(e) {
230
+ this._containerMeasurements = e.nativeEvent.layout;
231
+ this.updateView({
232
+ value: this.props.scrollValue.__getValue()
233
+ });
234
+ }
235
+ });
236
+ module.exports = ScrollableTabBar;
237
+ const styles = StyleSheet.create({
238
+ tab: {
239
+ height: 49,
240
+ alignItems: 'center',
241
+ justifyContent: 'center',
242
+ paddingLeft: 20,
243
+ paddingRight: 20
244
+ },
245
+ container: {
246
+ height: 50,
247
+ borderWidth: 1,
248
+ borderTopWidth: 0,
249
+ borderLeftWidth: 0,
250
+ borderRightWidth: 0,
251
+ borderColor: '#ccc'
252
+ },
253
+ tabs: {
254
+ flexDirection: 'row',
255
+ justifyContent: 'space-around'
256
+ }
257
+ });
258
+ //# sourceMappingURL=ScrollableTabBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","require","ReactNative","DeprecatedPropTypes","PropTypes","createReactClass","View","Animated","StyleSheet","ScrollView","Text","Platform","Dimensions","Button","OS","WINDOW_WIDTH","get","width","ScrollableTabBar","displayName","propTypes","goToPage","func","activeTab","number","tabs","array","backgroundColor","string","activeTextColor","inactiveTextColor","scrollOffset","style","ViewPropTypes","tabStyle","tabsContainerStyle","textStyle","TextPropTypes","renderTab","underlineStyle","onScroll","getDefaultProps","getInitialState","_tabsMeasurements","_leftTabUnderline","Value","_widthTabUnderline","_containerWidth","componentDidMount","props","scrollValue","addListener","updateView","offset","position","Math","floor","value","pageOffset","tabCount","length","lastTabPosition","necessarilyMeasurementsCompleted","updateTabPanel","updateTabUnderline","isLastTab","_tabContainerMeasurements","_containerMeasurements","containerWidth","tabWidth","nextTabMeasurements","nextTabWidth","tabOffset","left","absolutePageOffset","newScrollX","rightBoundScroll","_scrollView","scrollTo","x","y","animated","lineLeft","lineRight","right","nextTabLeft","nextTabRight","newLineLeft","newLineRight","state","setValue","name","page","isTabActive","onPressHandler","onLayoutHandler","textColor","fontWeight","createElement","key","accessible","accessibilityLabel","accessibilityTraits","onPress","onLayout","styles","tab","color","measureTab","event","height","nativeEvent","layout","__getValue","render","tabUnderlineStyle","bottom","dynamicTabUnderline","container","onContainerLayout","ref","scrollView","horizontal","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","directionalLockEnabled","bounces","scrollsToTop","scrollEventThrottle","onTabContainerLayout","map","bind","componentDidUpdate","prevProps","JSON","stringify","setState","e","module","exports","create","alignItems","justifyContent","paddingLeft","paddingRight","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderColor","flexDirection"],"sourceRoot":"..\\..\\src","sources":["ScrollableTabBar.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,IAAI;EACJC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,IAAI;EACJC,QAAQ;EACRC;AACF,CAAC,GAAGV,WAAW;AACf,MAAMW,MAAM,GAAGF,QAAQ,CAACG,EAAE,KAAK,KAAK,GAAGb,OAAO,CAAC,iBAAiB,CAAC,GAAGA,OAAO,CAAC,qBAAqB,CAAC;AAElG,MAAMc,YAAY,GAAGH,UAAU,CAACI,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK;AAEnD,MAAMC,gBAAgB,GAAGb,gBAAgB,CAAC;EAAAc,WAAA;EACxCC,SAAS,EAAE;IACTC,QAAQ,EAAEjB,SAAS,CAACkB,IAAI;IACxBC,SAAS,EAAEnB,SAAS,CAACoB,MAAM;IAC3BC,IAAI,EAAErB,SAAS,CAACsB,KAAK;IACrBC,eAAe,EAAEvB,SAAS,CAACwB,MAAM;IACjCC,eAAe,EAAEzB,SAAS,CAACwB,MAAM;IACjCE,iBAAiB,EAAE1B,SAAS,CAACwB,MAAM;IACnCG,YAAY,EAAE3B,SAAS,CAACoB,MAAM;IA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,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,WAAW,EAAE,EAAE;IACfC,YAAY,EAAE;EAChB,CAAC;EACD1B,SAAS,EAAE;IACTR,MAAM,EAAE,EAAE;IACVmC,WAAW,EAAE,CAAC;IACdC,cAAc,EAAE,CAAC;IACjBC,eAAe,EAAE,CAAC;IAClBC,gBAAgB,EAAE,CAAC;IACnBC,WAAW,EAAE;EACf,CAAC;EACD5H,IAAI,EAAE;IACJ6H,aAAa,EAAE,KAAK;IACpBR,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ const React = require('react');
4
+ class StaticContainer extends React.Component {
5
+ shouldComponentUpdate(nextProps) {
6
+ return !!nextProps.shouldUpdate;
7
+ }
8
+ render() {
9
+ var child = this.props.children;
10
+ if (child === null || child === false) {
11
+ return null;
12
+ }
13
+ return React.Children.only(child);
14
+ }
15
+ }
16
+ module.exports = StaticContainer;
17
+ //# sourceMappingURL=StaticContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","require","StaticContainer","Component","shouldComponentUpdate","nextProps","shouldUpdate","render","child","props","children","Children","only","module","exports"],"sourceRoot":"..\\..\\src","sources":["StaticContainer.js"],"mappings":";;AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC;AAE9B,MAAMC,eAAe,SAASF,KAAK,CAACG,SAAS,CAAC;EAE5CC,qBAAqBA,CAACC,SAAiB,EAAW;IAChD,OAAO,CAAC,CAACA,SAAS,CAACC,YAAY;EACjC;EAEAC,MAAMA,CAAA,EAAkB;IACtB,IAAIC,KAAK,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ;IAC/B,IAAIF,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,EAAE;MACrC,OAAO,IAAI;IACb;IACA,OAAOR,KAAK,CAACW,QAAQ,CAACC,IAAI,CAACJ,KAAK,CAAC;EACnC;AAEF;AAEAK,MAAM,CAACC,OAAO,GAAGZ,eAAe","ignoreList":[]}