/
drop-mode.jsx
51 lines (47 loc) · 1.15 KB
/
drop-mode.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react';
import ReactDOM from 'react-dom';
import {htmlTab, jsxTab} from "./prism-tabs";
import {DockLayout} from '../lib';
let dropModeTab = {
title: 'Drop Mode',
content: (
<div>
<p>When you set <b>dropMode</b>='edge' on <DockLayout></p>
<p>The distance between mouse cursor and panel border is used to pick drop location.</p>
</div>
)
};
let tab = {
title: 'Tab',
content: <div>Tab Content</div>
};
let box = {
dockbox: {
mode: 'horizontal',
children: [
{
mode: 'vertical',
children: [
{
tabs: [{...dropModeTab, id: 't1'}, jsxTab, htmlTab],
},
{
tabs: [{...tab, id: 't4'}, {...tab, id: 't5'}, {...tab, id: 't6'}],
}
]
},
{
tabs: [{...tab, id: 't7'}, {...tab, id: 't8'}, {...tab, id: 't9'}],
},
]
}
};
class Demo extends React.Component {
render() {
return (
<DockLayout defaultLayout={box} dropMode='edge'
style={{position: 'absolute', left: 10, top: 10, right: 10, bottom: 10}}/>
);
}
}
ReactDOM.render(<Demo/>, document.getElementById('app'));