(this["webpackJsonpcustom-dataframe-example"]=this["webpackJsonpcustom-dataframe-example"]||[]).push([[0],{18:function(e,t,n){e.exports=n(33)},33:function(e,t,n){"use strict";n.r(t);var a=n(5),l=n.n(a),r=n(15),o=n.n(r),c=n(0),u=n(1),i=n(2),s=n(3),m=n(10),d=n(11),p=n(17),b=function(e){Object(i.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(u.a)(this,n);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={checks:Object(m.range)(0,e.props.element.dataRows).map((function(t){var n=e.props.element.getCell(t+1,e.props.evaluationColumn+1).content,a=0;return null!=n&&(a=Number(n)),a})),result:[[]]},e.returnClicked=function(){for(var t=[["Row","Smiles","Rating"]],n=0;n<e.state.checks.length;n++)if(0!=e.state.checks[n]){var a=[n],l=String(e.props.element.getCell(n+1,e.props.smilesColumn+1).content);a.push(l),a.push(e.state.checks[n]),t.push(a)}e.setState({result:t})},e.addClick=function(t,n){e.state.checks[t-1]=n,e.returnClicked()},e.render=function(){var t=e.props.element,n=t.headerRows>0,a=t.dataRows>0,r=t.caption?l.a.createElement("caption",null,t.caption):null,o=e.props.width+"px",c=e.props.height+"px",u={};return u=e.props.width<0?{height:c,overflow:"scroll"}:{height:c,width:o,overflow:"scroll"},l.a.createElement("html",null,l.a.createElement("body",null,l.a.createElement("div",{style:u},l.a.createElement("table",null,r,n&&l.a.createElement("thead",null,l.a.createElement(k,{isHeader:!0,table:t,clickFunction:e.addClick,evaluationColumn:e.props.evaluationColumn+1})),l.a.createElement("tbody",null,a?l.a.createElement(k,{isHeader:!1,table:t,clickFunction:e.addClick,evaluationColumn:e.props.evaluationColumn+1}):l.a.createElement("tr",null,l.a.createElement("td",{colSpan:t.columns||1},"empty"))))),l.a.createElement(p.CSVLink,{className:"myButton",data:e.state.result,enclosingCharacter:"",filename:"smiles_rating.csv"},"Download Rating")))},e}return Object(c.a)(n)}(l.a.PureComponent),k=function(e){var t=e.isHeader,n=e.table,r=n.headerRows,o=n.rows,c=t?0:r,u=t?r:o,i=Object(m.range)(c,u).map((function(t){return l.a.createElement("tr",{key:t},l.a.createElement(g,{rowIndex:t,table:n,clickFunction:e.clickFunction,evaluationColumn:e.evaluationColumn}))}));return l.a.createElement(a.Fragment,null,i)},g=function(e){var t=e.rowIndex,n=e.table,r=n.columns,o=function(n){e.clickFunction(t,Number(n.target.id))},c=Object(m.range)(0,r).map((function(a){var r,c=n.getCell(t,a),u=c.content,i=c.type;r=null!=u?u.toString():"";var s=t+"-"+a;switch(i){case"blank":return l.a.createElement("th",{key:s});case"index":return l.a.createElement("th",{key:s,scope:"row"},r);case"columns":return l.a.createElement("th",{key:s,scope:"col",id:s},r);case"data":return-1===r.indexOf("<img src=")?a===e.evaluationColumn?l.a.createElement("td",{id:s,key:s},l.a.createElement(h,{row:t,formattedContent:r,passRow:o})):l.a.createElement("td",{key:s,id:s},r):l.a.createElement("td",{key:s,id:s},l.a.createElement("div",{dangerouslySetInnerHTML:{__html:r}}));default:throw new Error('Cannot parse type "'.concat(i,'".'))}}));return l.a.createElement(a.Fragment,null,c)},h=function(e){var t={backgroundColor:"red",color:"black",border:"2px solid black"},n=e.row+"_1",a={backgroundColor:"yellow",color:"black",border:"2px solid black"},r=e.row+"_2",o={backgroundColor:"green",color:"black",border:"2px solid black"},c=e.row+"_3";"1"==e.formattedContent?t={backgroundColor:"black",color:"white",border:"2px solid red"}:"2"==e.formattedContent?a={backgroundColor:"black",color:"white",border:"2px solid yellow"}:"3"==e.formattedContent&&(o={backgroundColor:"black",color:"white",border:"2px solid green"});var u=function(t){e.passRow(t);var a=document.getElementsByName(n)[0],l=document.getElementsByName(r)[0],o=document.getElementsByName(c)[0];null!=a&&("1"==t.target.id?(i(a),s(l),s(o)):"2"==t.target.id?(i(l),s(a),s(o)):(i(o),s(l),s(a)))},i=function(e){e.style.border="2px solid "+e.style.backgroundColor,e.style.background="black",e.style.color="white"},s=function(e){"1"==e.id?e.style.background="red":"2"==e.id?e.style.background="yellow":e.style.background="green",e.style.border="2px solid black",e.style.color="black"};return l.a.createElement("body",null,l.a.createElement("button",{onClick:u,name:n,id:"1",style:t},"1"),l.a.createElement("button",{onClick:u,name:r,id:"2",style:a},"2"),l.a.createElement("button",{onClick:u,name:c,id:"3",style:o},"3"))},C=Object(d.b)((function(e){return Object(a.useEffect)((function(){d.a.setFrameHeight()})),l.a.createElement(b,{element:e.args.data,evaluationColumn:e.args.evaluationColumn,smilesColumn:e.args.smilesColumn,width:e.args.width,height:e.args.height})}));o.a.render(l.a.createElement(l.a.StrictMode,null,l.a.createElement(C,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.731e1c82.chunk.js.map