var Tbody;import"./tr.js";import autoBind from"react-autobind";export default window.Tbody=Tbody=class extends React.Component{constructor(t){var e,r,o,n,s;super(t),this.state={columns:null!=(e=t.columns)?e:[],data:null!=(r=t.data)?r:[],controller:null!=(o=t.controller)?o:"",column_render:null!=(n=t.column_render)?n:{},row_click:null!=(s=t.row_click)?s:"",sortable:!0===t.sortable},autoBind(this),this.tbody=null,this.rows={}}onSelect(){var t;return"function"==typeof(t=this.props).onSelect?t.onSelect():void 0}getSelected(){var t,e,r;for(t in e=[],this.rows)null!=(r=this.rows[t])&&r.state.selected&&e.push(r);return e}selectAll(t=!0){var e,r,o;for(e in r=[],this.rows)null!=(o=this.rows[e])?r.push(o.setSelect(t)):r.push(void 0);return r}componentWillReceiveProps(t){return this.setState({data:t.data})}init(){var t,e;if(console.log("intiSortable??"),({controller:t,data:e}=this.state),this.state.sortable)return $(this.tbody).sortable({handle:".up_down",start:function(t,e,r){return $(r).hide()},stop:function(e,r,o){var n,s,l;return l=(n=$(r)).index(),s=n.attr("data-id"),API(t+"/updatePosForID",{id:s,pos:l})}})}componentDidMount(){return this.init()}renderTr(t){var e=this;return React.createElement(Tr,{data:t.data,id:t.id,controller:this.state.controller,column_render:this.state.column_render,row_click:this.state.row_click,key:t.id,openUadd:this.props.openUadd,sortable:this.state.sortable,onSelect:this.onSelect,ref:function(r){return e.rows[t.id]=r}})}render(){var t,e=this;return({data:t}=this.state),React.createElement("tbody",{ref:function(t){return e.tbody=t}},t.map(this.renderTr))}}; //# sourceMappingURL=tbody.min.js.map