import { render } from 'react-dom';
import './index.css';
import * as React from 'react';
import { SampleBase } from './sample-base';
import { SplitterComponent, PanesDirective, PaneDirective } from '@syncfusion/ej2-react-layouts';
/**
* Splitter Basic rendering
*/
export class Basic extends SampleBase {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
this.leftPaneTemplate = this.leftPaneTemplate.bind(this);
this.state = { value: 'Type here!' };
}
handleChange(e) {
this.setState({ value: e.target.value });
}
leftPaneTemplate() {
return (<div>
<h1>{this.state.value}</h1>
</div>);
}
rightPaneTemplate() {
return (<div>
<h1>Hello World!</h1>
</div>);
}
render() {
return (
<div id="defaultSplitter" className="control-section">
<textarea
id="markdown-content"
onChange={this.handleChange}
defaultValue={this.state.value}
/>
<div className="pane1">
<div id="pane-heading">Horizontal Splitter</div>
<SplitterComponent height="110px" width="100%" separatorSize={4}>
<PanesDirective>
<PaneDirective size={"200px"} content={this.leftPaneTemplate}/>
<PaneDirective content = {this.rightPaneTemplate}/>
</PanesDirective>
</SplitterComponent>
</div>
</div>);
}
}
render(<Basic />, document.getElementById('sample'));