/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict'; /*eslint no-console-disallow: "off"*/ /*global React:true*/ // TODO: // selection and arrow keys for navigating var _jsxFileName='src/table.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;isIndex){ dIndex--;} active.splice(sIndex,1); active.splice(dIndex,0,dragged); aggrow.setActiveAggregators(active); this.forceUpdate();}else if(s.startsWith('expander:active:')){ var _sIndex=parseInt(s.substr(16),10); var _dIndex=-1; var _active=aggrow.getActiveExpanders(); var _dragged=_active[_sIndex]; if(d.startsWith('expander:insert:')){ _dIndex=parseInt(d.substr(16),10);}else if(d==='divider:insert'){ _dIndex=0;}else { throw 'not allowed to drag '+s+' to '+d;} if(_dIndex>_sIndex){ _dIndex--;} _active.splice(_sIndex,1); _active.splice(_dIndex,0,_dragged); aggrow.setActiveExpanders(_active); this.forceUpdate();}}},{key:'render',value:function render() {var _this4=this; var headers=[]; var aggrow=this.state.aggrow; var aggregators=aggrow.getActiveAggregators(); var expanders=aggrow.getActiveExpanders(); // aggregators for(var i=0;i':'...'; headers.push( React.createElement(DropTarget,{ id:'expander:insert:'+(_i+1).toString(), dropFilter:function dropFilter(){return true;}, dropAction:function dropAction(s,d){_this4.dropAggregator(s,d);},__source:{fileName:_jsxFileName,lineNumber:193}}, React.createElement('div',{style:{ height:'inherit', backgroundColor:'darkGray', flexShrink:'0'},__source:{fileName:_jsxFileName,lineNumber:198}}, sep)));} return ( React.createElement('div',{style:{width:'100%',height:'100%',display:'flex',flexDirection:'column'},__source:{fileName:_jsxFileName,lineNumber:210}}, React.createElement('div',{style:{ width:'100%', height:'26px', display:'flex', flexDirection:'row', alignItems:'center', borderBottom:'2px solid black'},__source:{fileName:_jsxFileName,lineNumber:211}}, headers), React.createElement('div',{style:{ width:'100%', flexGrow:'1', overflow:'scroll'}, onScroll:function onScroll(e){return _this4.scroll(e);},__source:{fileName:_jsxFileName,lineNumber:221}}, React.createElement('div',{style:{position:'relative'},__source:{fileName:_jsxFileName,lineNumber:226}}, this.renderVirtualizedRows()))));}},{key:'renderVirtualizedRows',value:function renderVirtualizedRows() {var _this5=this; var aggrow=this.state.aggrow; var viewport=this.state.viewport; var rows=aggrow.getRows(viewport.top,viewport.height); return ( React.createElement('div',{style:{ position:'absolute', width:'100%', height:(rowHeight*(aggrow.getHeight()+20)).toString()+'px'},__source:{fileName:_jsxFileName,lineNumber:239}}, rows.map(function(child){return _this5.renderRow(child);})));}},{key:'renderRow',value:function renderRow( row){var _this6=this; if(row===null){ return null;} var bg='lightGray'; var aggrow=this.state.aggrow; var columns=[]; var rowText=''; var indent=4+aggrow.getRowIndent(row)*treeIndent; var aggregates=aggrow.getActiveAggregators(); if(row.parent!==null&&row.parent.expander%2===0){ bg='white';} for(var i=0;i