UNPKG

crn-cli

Version:

The Ctrip React Native CLI Tools

1 lines 3.31 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]),s=r(d[3]),l=r(d[4]),p=r(d[5]),c=r(d[6]),h=r(d[7]),u=r(d[8]),y=r(d[9]),f=r(d[10]),v=r(d[11]),C=r(d[12]),E=r(d[13]),S=(function(p){function h(){var n,l;t(this,h);for(var p=arguments.length,c=new Array(p),u=0;u<p;u++)c[u]=arguments[u];return(l=o(this,(n=s(h)).call.apply(n,[this].concat(c))))._onPress=function(){l.props.onPress?l.props.onPress():l.props.onNavigate(v.ExampleAction(l.props.item.key))},l}return l(h,p),n(h,[{key:"render",value:function(){var t=this.props.item;return c.createElement(f,{onShowUnderlay:this.props.onShowUnderlay,onHideUnderlay:this.props.onHideUnderlay,onPress:this._onPress},c.createElement(E,{style:x.row},c.createElement(y,{style:x.rowTitleText},t.module.title),c.createElement(y,{style:x.rowDetailText},t.module.description)))}}]),h})(c.PureComponent),w=function(t){var n=t.section;return c.createElement(y,{style:x.sectionHeader},n.title)},b=(function(u){function y(){var n,l;t(this,y);for(var p=arguments.length,h=new Array(p),u=0;u<p;u++)h[u]=arguments[u];return(l=o(this,(n=s(y)).call.apply(n,[this].concat(h))))._renderItem=function(t){var n=t.item,o=t.separators;return c.createElement(S,{item:n,onNavigate:l.props.onNavigate,onShowUnderlay:o.highlight,onHideUnderlay:o.unhighlight})},l}return l(y,u),n(y,[{key:"render",value:function(){var t=this,n=[{data:this.props.list.ComponentExamples,title:'COMPONENTS',key:'c'},{data:this.props.list.APIExamples,title:'APIS',key:'a'}];return c.createElement(E,{style:[x.listContainer,this.props.style]},this._renderTitleRow(),c.createElement(C,{testID:"explorer_search",sections:n,filter:function(t){var n=t.example;return t.filterRegex.test(n.module.title)&&(!p.isTV||n.supportsTVOS)},render:function(n){var o=n.filteredSections;return c.createElement(h,{ItemSeparatorComponent:k,contentContainerStyle:x.sectionListContentContainer,style:x.list,sections:o,renderItem:t._renderItem,enableEmptySections:!0,itemShouldUpdate:t._itemShouldUpdate,keyboardShouldPersistTaps:"handled",automaticallyAdjustContentInsets:!1,keyboardDismissMode:"on-drag",renderSectionHeader:w})}}))}},{key:"_itemShouldUpdate",value:function(t,n){return t.item!==n.item}},{key:"_renderTitleRow",value:function(){var t=this;return this.props.displayTitleRow?c.createElement(S,{item:{module:{title:'RNTester',description:'React Native Examples'}},onNavigate:this.props.onNavigate,onPress:function(){t.props.onNavigate(v.ExampleList())}}):null}},{key:"_handleRowPress",value:function(t){this.props.onNavigate(v.ExampleAction(t))}}]),y})(c.Component),k=function(t){var n=t.highlighted;return c.createElement(E,{style:n?x.separatorHighlighted:x.separator})},x=u.create({listContainer:{flex:1},list:{backgroundColor:'#eeeeee'},sectionHeader:{backgroundColor:'#eeeeee',padding:5,fontWeight:'500',fontSize:11},row:{backgroundColor:'white',justifyContent:'center',paddingHorizontal:15,paddingVertical:8},separator:{height:u.hairlineWidth,backgroundColor:'#bbbbbb',marginLeft:15},separatorHighlighted:{height:u.hairlineWidth,backgroundColor:'rgb(217, 217, 217)'},sectionListContentContainer:{backgroundColor:'white'},rowTitleText:{fontSize:17,fontWeight:'500'},rowDetailText:{fontSize:15,color:'#888888',lineHeight:20}});m.exports=b},666683,[3,4,5,8,9,53,11,250,55,180,319,666677,666680,80]);