-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPlaceAssistantsAboveChildren.jsx
108 lines (102 loc) · 2.9 KB
/
PlaceAssistantsAboveChildren.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import React, { Component } from 'react';
import { OrgDiagram } from '../Diagrams';
import { Enabled, PageFitMode, GroupByType, OrgItemConfig, ItemType, AdviserPlacementType } from 'basicprimitives';
class Sample extends Component {
constructor(props) {
super(props);
this.state = {
placeAssistantsAboveChildren: false
}
}
onPlaceAssistantsAboveChildrenChanged(placeAssistantsAboveChildren) {
this.setState({ placeAssistantsAboveChildren });
}
render() {
const { placeAssistantsAboveChildren } = this.state;
const config = {
placeAssistantsAboveChildren,
hasSelectorCheckbox: Enabled.False,
pageFitMode: PageFitMode.None,
arrowsDirection: GroupByType.Children,
items: [
new OrgItemConfig({
id: 0,
parent: null,
title: "James Smith",
description: "Parent Item",
image: "./photos/a.png"
}),
new OrgItemConfig({
id: 5,
parent: 0,
title: "Harry Harter",
description: "Regular Item",
groupTitle: "Regular",
image: "./photos/d.png"
}),
new OrgItemConfig({
id: 6,
parent: 0,
title: "Fritz Stuger",
description: "Regular Item",
groupTitle: "Regular",
image: "./photos/d.png"
}),
new OrgItemConfig({
id: 8,
parent: 0,
itemType: ItemType.Assistant,
adviserPlacementType: AdviserPlacementType.Right,
title: "Ted Lucas",
description: "Assitant Item",
groupTitle: "Assistant",
image: "./photos/c.png"
}),
new OrgItemConfig({
id: 10,
parent: 8,
title: "James Nunnally",
description: "Regular Item",
image: "./photos/d.png"
}),
new OrgItemConfig({
id: 11,
parent: 8,
title: "Robert Canon",
description: "Regular Item",
image: "./photos/d.png"
})
]
};
return <>
<p>Place Assistants Above Children:
<br />
<label>
<input
onChange={() => this.onPlaceAssistantsAboveChildrenChanged(true)}
name="placeAssistantsAboveChildren"
type="radio"
value="1"
checked={placeAssistantsAboveChildren === true ? 'checked' : ''}
/>
True
</label>
<br />
<label>
<input
onChange={() => this.onPlaceAssistantsAboveChildrenChanged(false)}
name="placeAssistantsAboveChildren"
type="radio"
value="0"
checked={placeAssistantsAboveChildren === false ? 'checked' : ''}
/>
False
</label>
</p>
<div className="placeholder">
<OrgDiagram centerOnCursor={true} config={config} />
</div>
</>
}
}
export default Sample;