crn-cli
Version:
The Ctrip React Native CLI Tools
1 lines • 2.88 kB
JavaScript
__d(function(g,r,i,a,m,e,d){'use strict';r(d[0]);var t=r(d[1]),l=r(d[2]),n=r(d[3]),o=r(d[4]),c=r(d[5]),s=(r(d[6]),r(d[7])),u=r(d[8]),h=u.ScrollView,p=u.StyleSheet,f=u.Text,y=u.TouchableOpacity,E=u.View,b=u.Image;e.displayName='ScrollViewExample',e.title='<ScrollView>',e.description='Component that enables scrolling through child components',e.examples=[{title:'<ScrollView>\n',description:'To make content scrollable, wrap it within a <ScrollView> component',render:function(){var t;return s.createElement(E,null,s.createElement(h,{ref:function(l){t=l},automaticallyAdjustContentInsets:!1,onScroll:function(){},scrollEventThrottle:200,style:T.scrollView},w.map(V)),s.createElement(v,{label:"Scroll to top",onPress:function(){t.scrollTo({y:0})}}),s.createElement(v,{label:"Scroll to bottom",onPress:function(){t.scrollToEnd({animated:!0})}}),s.createElement(v,{label:"Flash scroll indicators",onPress:function(){t.flashScrollIndicators()}}))}},{title:'<ScrollView> (horizontal = true)\n',description:"You can display <ScrollView>'s child components horizontally rather than vertically",render:function(){function t(t,l){var n;return s.createElement(E,{style:l},s.createElement(f,{style:T.text},t),s.createElement(h,{ref:function(t){n=t},automaticallyAdjustContentInsets:!1,horizontal:!0,style:[T.scrollView,T.horizontalScrollView]},w.map(V)),s.createElement(v,{label:"Scroll to start",onPress:function(){n.scrollTo({x:0})}}),s.createElement(v,{label:"Scroll to end",onPress:function(){n.scrollToEnd({animated:!0})}}),s.createElement(v,{label:"Flash scroll indicators",onPress:function(){n.flashScrollIndicators()}}))}return s.createElement(E,null,t('LTR layout',{direction:'ltr'}),t('RTL layout',{direction:'rtl'}))}}];var S=(function(u){function h(){return t(this,h),n(this,o(h).apply(this,arguments))}return c(h,u),l(h,[{key:"render",value:function(){var t=this.props.source;return s.createElement(E,{style:[T.thumb,this.props.style]},s.createElement(b,{style:T.img,source:null==t?w[6]:t}),s.createElement(f,null,this.props.msg))}}]),h})(s.PureComponent),w=[r(d[9]),r(d[10]),r(d[11]),r(d[12]),r(d[13]),r(d[14]),r(d[15]),r(d[16]),r(d[17]),r(d[18]),r(d[19]),r(d[20])];w=w.concat(w);var V=function(t,l){return s.createElement(S,{key:l,source:t})},v=function(t){var l=t.label,n=t.onPress;return s.createElement(y,{style:T.button,onPress:n},s.createElement(f,null,l))},T=p.create({scrollView:{backgroundColor:'#eeeeee',height:300},horizontalScrollView:{height:106},text:{fontSize:16,fontWeight:'bold',margin:5},button:{margin:5,padding:5,alignItems:'center',backgroundColor:'#cccccc',borderRadius:3},row:{flexDirection:'row',justifyContent:'space-around'},thumb:{margin:5,padding:5,backgroundColor:'#cccccc',borderRadius:3,minWidth:96},img:{width:64,height:64}})},666727,[30,3,4,5,8,9,356,11,15,666691,666692,666693,666694,666695,666696,666697,666698,666699,666700,666701,666702]);