crn-cli
Version:
The Ctrip React Native CLI Tools
1 lines • 3.02 kB
JavaScript
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),n=r(d[1]),l=r(d[2]),o=r(d[3]),s=r(d[4]),u=r(d[5]),p=r(d[6]),c=r(d[7]),E=c.StyleSheet,y=c.View,b=c.Text,f=c.TouchableHighlight,v=c.Alert,w=r(d[8]).SimpleAlertExampleBlock,h=(function(c){function E(n){var u;return t(this,E),(u=l(this,o(E).call(this,n))).saveResponse=u.saveResponse.bind(s(u)),u.customButtons=[{text:'Custom OK',onPress:u.saveResponse},{text:'Custom Cancel',style:'cancel'}],u.state={promptValue:void 0},u}return u(E,c),n(E,[{key:"render",value:function(){var t=this;return p.createElement(y,null,p.createElement(b,{style:P.promptValue},p.createElement(b,{style:P.promptValueLabel},"Prompt value:"),' ',this.state.promptValue),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Type a value',null,t.saveResponse)}},p.createElement(y,{style:P.button},p.createElement(b,null,"prompt with title & callback"))),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Type a value',null,t.customButtons)}},p.createElement(y,{style:P.button},p.createElement(b,null,"prompt with title & custom buttons"))),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Type a phone number',null,null,'plain-text',void 0,'phone-pad')}},p.createElement(y,{style:P.button},p.createElement(b,null,"prompt with title & custom keyboard"))),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Type a value',null,t.saveResponse,void 0,'Default value')}},p.createElement(y,{style:P.button},p.createElement(b,null,"prompt with title, callback & default value"))),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Type a value',null,t.customButtons,'login-password','admin@site.com')}},p.createElement(y,{style:P.button},p.createElement(b,null,"prompt with title, custom buttons, login/password & default value"))))}},{key:"saveResponse",value:function(t){this.setState({promptValue:JSON.stringify(t)})}}]),E})(p.Component),P=E.create({wrapper:{borderRadius:5,marginBottom:5},button:{backgroundColor:'#eeeeee',padding:10},promptValue:{marginBottom:10},promptValueLabel:{fontWeight:'bold'}});e.framework='React',e.title='Alert',e.description='iOS alerts and action sheets',e.examples=[{title:'Alerts',render:function(){return p.createElement(w,null)}},{title:'Prompt Options',render:function(){return p.createElement(h,null)}},{title:'Prompt Types',render:function(){return p.createElement(y,null,p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Plain Text Entry')}},p.createElement(y,{style:P.button},p.createElement(b,null,"plain-text"))),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Secure Text',null,null,'secure-text')}},p.createElement(y,{style:P.button},p.createElement(b,null,"secure-text"))),p.createElement(f,{style:P.wrapper,onPress:function(){return v.prompt('Login & Password',null,null,'login-password')}},p.createElement(y,{style:P.button},p.createElement(b,null,"login-password"))))}}]},666750,[3,4,5,8,7,9,11,15,666751]);