|
| 1 | +"use strict"; |
| 2 | +var__extends=(this&&this.__extends)||function(d,b){ |
| 3 | +for(varpinb)if(b.hasOwnProperty(p))d[p]=b[p]; |
| 4 | +function__(){this.constructor=d;} |
| 5 | +d.prototype=b===null ?Object.create(b) :(__.prototype=b.prototype,new__()); |
| 6 | +}; |
| 7 | +var__decorate=(this&&this.__decorate)||function(decorators,target,key,desc){ |
| 8 | +varc=arguments.length,r=c<3 ?target :desc===null ?desc=Object.getOwnPropertyDescriptor(target,key) :desc,d; |
| 9 | +if(typeofReflect==="object"&&typeofReflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc); |
| 10 | +elsefor(vari=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3 ?d(r) :c>3 ?d(target,key,r) :d(target,key))||r; |
| 11 | +returnc>3&&r&&Object.defineProperty(target,key,r),r; |
| 12 | +}; |
| 13 | +var__metadata=(this&&this.__metadata)||function(k,v){ |
| 14 | +if(typeofReflect==="object"&&typeofReflect.metadata==="function")returnReflect.metadata(k,v); |
| 15 | +}; |
| 16 | +varReact=require('react'); |
| 17 | +varreact_redux_1=require('react-redux'); |
| 18 | +varFlatButton_1=require('material-ui/FlatButton'); |
| 19 | +varactions_1=require('../actions'); |
| 20 | +varHintButton=(function(_super){ |
| 21 | +__extends(HintButton,_super); |
| 22 | +functionHintButton(){ |
| 23 | +_super.apply(this,arguments); |
| 24 | +} |
| 25 | +HintButton.prototype.render=function(){ |
| 26 | +var_a=this.props,hintPosition=_a.hintPosition,hintsLength=_a.hintsLength,label=_a.label,type=_a.type,hintSet=_a.hintSet; |
| 27 | +switch(type){ |
| 28 | +case'next': |
| 29 | +return(React.createElement(FlatButton_1.default,{label:label,disabled:hintPosition>hintsLength-2,onTouchTap:hintSet.bind(this,hintPosition+1)})); |
| 30 | +case'prev': |
| 31 | +return(React.createElement(FlatButton_1.default,{label:label,disabled:hintPosition===0,onTouchTap:hintSet.bind(this,hintPosition-1)})); |
| 32 | +} |
| 33 | +}; |
| 34 | +HintButton=__decorate([ |
| 35 | +react_redux_1.connect(null,function(dispatch){ |
| 36 | +return{ |
| 37 | +hintSet:function(position){returndispatch(actions_1.hintPositionSet(position));}, |
| 38 | +}; |
| 39 | +}), |
| 40 | +__metadata('design:paramtypes',[]) |
| 41 | +],HintButton); |
| 42 | +returnHintButton; |
| 43 | +}(React.Component)); |
| 44 | +Object.defineProperty(exports,"__esModule",{value:true}); |
| 45 | +exports.default=HintButton; |