-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.tsx
119 lines (110 loc) · 4.09 KB
/
test.tsx
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
109
110
111
112
113
114
115
116
117
118
119
import React, {useState} from 'react';
import Radio from '@mui/material/Radio';
import RadioGroup from '@mui/material/RadioGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormControl from '@mui/material/FormControl';
import { Checkbox, } from "@material-ui/core";
export default function ControlledRadioButtonsGroup() {
const params = ["hello_1", "hello_2", "hello_3"]
const [visualTypes, setVisualTypes] = useState({
graph:{
checked: false,
x:[],
y:[]
}
})
// const data = visualTypes;
// let visualType = "";
// let visualProps = null;
// for (let d of Object.keys(data)) {
// if (data[d].status === true) {
// if (d === "table") {
// visualType = d;
// }
// if (d === "graph") {
// for (let d2 of Object.keys(data[d]).filter(i=>i!=='status')) {
// if (data[d][d2].status === true) {
// visualType = d2;
// const parent2 = data[d][d2];
// if(d2 === 'line') {
// const p = parent2.primary.primary_y.map(i=>i.name)
// const s = parent2.secondary.secondary_y.map(i=>i.name)
// visualProps = {primary_y: p, secondary_y: s}
// } else {
// const x = parent2.x.x.map(i=>i.name)
// const y = parent2.y.y.map(i=>i.name)
// visualProps = {x, y}
// }
// }
// }
// }
// }
// }
// console.log("VVVVVV:", visualType, visualProps)
return (
<div className="w-100 position-absolute drop-visual-selctor ">
<FormControl
component="fieldset"
className="w-100 float-left"
>
<RadioGroup>
<FormControlLabel
value={"graph"}
onChange={(e,value)=>console.log(e.target, value)}
control={<Radio/>}
label="Graph"
className="main-cate-selector w-100 float-left"
/>
<div className="w-100 float-left inside-wrap-v-opt pl-4">
<RadioGroup>
<div className="w-100 float-left inside-cate-01">
<FormControlLabel
value={"line"}
control={<Radio/>}
label="Line"
/>
<div className="w-100 float-left inside-cate-02 ">
<div className="w-100 float-left inside-cate-03 pl-4">
<FormControlLabel
value={"primary_y"}
control={<Checkbox color="primary"/>}
label="Primary"
labelPlacement="end"
className="w-100 float-left"
/>
<div className="w-100 float-left inside-cate-04 pl-4">
<FormControlLabel
control={
<Checkbox color="primary" />
}
label={"PRI 1"}
labelPlacement="end"
className="w-100 float-left"
/>
</div>
<FormControlLabel
control={<Checkbox color="primary" />}
label="Secondary "
labelPlacement="end"
className="w-100 float-left"
/>
<div className="w-100 float-left inside-cate-04 pl-4">
<FormControlLabel
control={
<Checkbox color="primary" />
}
label={"SEC 1"}
labelPlacement="end"
className="w-100 float-left"
/>
</div>
</div>
</div>
</div>
</RadioGroup>
</div>
</RadioGroup>
</FormControl>
</div>
);
}