UNPKG

crn-cli

Version:

The Ctrip React Native CLI Tools

1 lines 2.92 kB
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),s=r(d[6]),p=r(d[7]),h=p.Image,w=p.SwipeableListView,f=p.TouchableHighlight,S=p.StyleSheet,v=p.Text,y=p.View,b=p.Alert,x=r(d[8]),C=(function(p){function S(){var o,c,s;n(this,S);for(var p=arguments.length,h=new Array(p),f=0;f<p;f++)h[f]=arguments[f];return(s=l(this,(o=u(S)).call.apply(o,[this].concat(h)))).state={dataSource:(c=w.getNewDataSource()).cloneWithRowsAndSections.apply(c,t(s._genDataSource({})))},s._pressData={},s}return c(S,p),o(S,[{key:"render",value:function(){return s.createElement(x,{title:this.props.navigator?null:'<SwipeableListView>',noSpacer:!0,noScroll:!0},s.createElement(w,{dataSource:this.state.dataSource,maxSwipeDistance:100,renderQuickActions:function(t,n,o){return s.createElement(y,{style:k.actionsContainer},s.createElement(f,{onPress:function(){b.alert('Tips','You could do something with this row: '+t.text)}},s.createElement(v,null,"Remove")))},renderRow:this._renderRow,renderSeparator:this._renderSeperator}))}},{key:"_renderRow",value:function(t,n,o){var l=Math.abs(_(t.id)),u=E[l%E.length];return s.createElement(f,{onPress:function(){}},s.createElement(y,null,s.createElement(y,{style:k.row},s.createElement(h,{style:k.thumb,source:u}),s.createElement(v,{style:k.text},t.id+' - '+R.substr(0,l%301+10)))))}},{key:"_genDataSource",value:function(t){var n={},o=['Section 0'],l=[[]];n['Section 0']={};for(var u=0;u<100;u++){var c=t[u]?' (pressed)':'';n[o[0]]['Row '+u]={id:'Row '+u,text:'Row '+u+c},l[0].push('Row '+u)}return[n,o,l]}},{key:"_renderSeperator",value:function(t,n,o){return s.createElement(y,{key:t+"-"+n,style:{height:o?4:1,backgroundColor:o?'#3B5998':'#CCCCCC'}})}}]),S})(s.Component),E=[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])],R=['Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix ','civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi ','adipiscing. Sea id integre luptatum. In tota sale consequuntur nec. Erat ','ocurreret mei ei. Eu paulo sapientem vulputate est, vel an accusam ','intellegam interesset. Nam eu stet pericula reprimique, ea vim illud modus, ','putant invidunt reprehendunt ne qui.'].join(''),_=function(t){for(var n=15,o=t.length-1;o>=0;o--)n=(n<<5)-n+t.charCodeAt(o);return n},k=S.create({row:{flexDirection:'row',justifyContent:'center',padding:10,backgroundColor:'#F6F6F6'},thumb:{width:64,height:64},text:{flex:1},actionsContainer:{flex:1,flexDirection:'row',justifyContent:'flex-end',alignItems:'center'}});e.title='<SwipeableListView>',e.description='Performant, scrollable, swipeable list of data.',e.examples=[{title:'Simple swipable list',render:function(){return s.createElement(C,null)}}]},666737,[30,3,4,5,8,9,11,15,666681,666691,666692,666693,666694,666695,666696,666697,666698,666699,666700,666701,666702]);