@@ -3,7 +3,7 @@ import MenuItem from '@material-ui/core/MenuItem';
33import TextField from '@material-ui/core/TextField' ;
44
55import Button from '@material-ui/core/Button' ;
6-
6+ import Box from '@material-ui/core/Box'
77import Dialog from '@material-ui/core/Dialog/Dialog' ;
88
99import DialogActions from '@material-ui/core/DialogActions' ;
@@ -13,8 +13,10 @@ import DialogTitle from '@material-ui/core/DialogTitle';
1313
1414import { NetPyNESelectField , NetPyNEField , NetPyNECoordsRange } from 'netpyne/components' ;
1515import Utils from '../../../Utils' ;
16+ import ExpansionPanel from '../../general/ExpansionPanel'
17+ import { withStyles } from "@material-ui/core/styles"
1618
17- export default class NetPyNECellRule extends React . Component {
19+ class NetPyNECellRule extends React . Component {
1820
1921 constructor ( props ) {
2022 super ( props ) ;
@@ -68,7 +70,7 @@ export default class NetPyNECellRule extends React.Component {
6870 }
6971
7072 render ( ) {
71-
73+ const { classes } = this . props
7274 var dialogPop = ( this . state . errorMessage != undefined ? (
7375 < Dialog
7476 open = { true }
@@ -92,85 +94,94 @@ export default class NetPyNECellRule extends React.Component {
9294 )
9395 return (
9496 < div >
95- < div >
97+ < div className = { classes . root } >
9698
9799 < TextField
100+ variant = "filled"
98101 onChange = { this . handleRenameChange }
99102 value = { this . state . currentName }
100103 disabled = { this . renaming }
101- label = "The name of the cell rule"
102- className = { "netpyneField" }
104+ label = "The name of the cell type"
103105 id = { "cellRuleName" }
104- style = { { marginTop : 8 } }
105106 />
106107
107- < div style = { { float : 'left' , marginTop : '20px' } } >
108- < b > Conditions:</ b >
109- </ div >
110-
111- < NetPyNEField id = { "netParams.cellParams.conds.cellType" } >
112- < NetPyNESelectField
113- model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['cellType']" }
114- method = { "netpyne_geppetto.getAvailableCellTypes" }
115- postProcessItems = { this . postProcessMenuItems }
116- multiple = { true }
117- />
118- </ NetPyNEField >
119108
120- < NetPyNEField id = { "netParams.cellParams.conds.cellModel" } >
121- < NetPyNESelectField
122- model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['cellModel']" }
123- method = { "netpyne_geppetto.getAvailableCellModels" }
124- postProcessItems = { this . postProcessMenuItems }
125- multiple = { true }
126- />
127- </ NetPyNEField >
128-
129- < NetPyNEField id = { "netParams.cellParams.conds.pop" } >
130- < NetPyNESelectField
131- model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['pop']" }
132- method = { "netpyne_geppetto.getAvailablePops" }
133- postProcessItems = { this . postProcessMenuItems }
134- multiple = { true }
109+ < ExpansionPanel className = { classes . expandable } elevation = { 0 } >
110+ < Box mb = { 1 } >
111+ < b > Conditions (optional):</ b >
112+ </ Box >
113+
114+ < NetPyNEField id = { "netParams.cellParams.conds.cellModel" } >
115+ < NetPyNESelectField
116+ model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['cellModel']" }
117+ method = { "netpyne_geppetto.getAvailableCellModels" }
118+ postProcessItems = { this . postProcessMenuItems }
119+ multiple = { true }
120+ />
121+ </ NetPyNEField >
122+
123+ < NetPyNEField id = { "netParams.cellParams.conds.pop" } >
124+ < NetPyNESelectField
125+ model = { "netParams.cellParams['" + this . state . currentName + "']['conds']['pop']" }
126+ method = { "netpyne_geppetto.getAvailablePops" }
127+ postProcessItems = { this . postProcessMenuItems }
128+ multiple = { true }
129+ />
130+ </ NetPyNEField >
131+
132+ < NetPyNECoordsRange
133+ id = "xRangeCellParams"
134+ name = { this . state . currentName }
135+ model = { 'netParams.cellParams' }
136+ conds = { 'conds' }
137+ items = { [
138+ { value : 'x' , label : 'Absolute' } ,
139+ { value : 'xnorm' , label : 'Normalized' }
140+ ] }
135141 />
136- </ NetPyNEField >
137-
138- < NetPyNECoordsRange
139- id = "xRangeCellParams"
140- name = { this . state . currentName }
141- model = { 'netParams.cellParams' }
142- conds = { 'conds' }
143- items = { [
144- { value : 'x' , label : 'Absolute' } ,
145- { value : 'xnorm' , label : 'Normalized' }
146- ] }
147- />
148-
149- < NetPyNECoordsRange
150- id = "yRangeCellParams"
151- name = { this . state . currentName }
152- model = { 'netParams.cellParams' }
153- conds = { 'conds' }
154- items = { [
155- { value : 'y' , label : 'Absolute' } ,
156- { value : 'ynorm' , label : 'Normalized' }
157- ] }
158- />
159142
160- < NetPyNECoordsRange
161- id = "zRangeCellParams "
162- name = { this . state . currentName }
163- model = { 'netParams.cellParams' }
164- conds = { 'conds' }
165- items = { [
166- { value : 'z ' , label : 'Absolute' } ,
167- { value : 'znorm ' , label : 'Normalized' }
168- ] }
169- />
143+ < NetPyNECoordsRange
144+ id = "yRangeCellParams "
145+ name = { this . state . currentName }
146+ model = { 'netParams.cellParams' }
147+ conds = { 'conds' }
148+ items = { [
149+ { value : 'y ' , label : 'Absolute' } ,
150+ { value : 'ynorm ' , label : 'Normalized' }
151+ ] }
152+ />
170153
154+ < NetPyNECoordsRange
155+ id = "zRangeCellParams"
156+ name = { this . state . currentName }
157+ model = { 'netParams.cellParams' }
158+ conds = { 'conds' }
159+ items = { [
160+ { value : 'z' , label : 'Absolute' } ,
161+ { value : 'znorm' , label : 'Normalized' }
162+ ] }
163+ />
164+
165+ </ ExpansionPanel >
171166 </ div >
172167 { dialogPop }
173168 </ div >
174169 ) ;
175170 }
176171}
172+
173+
174+ const styles = ( { shape, spacing } ) => ( {
175+ expandable : {
176+ borderRadius : shape . borderRadius ,
177+ backgroundColor : 'inherit' ,
178+ paddingTop : spacing ( 2 ) ,
179+ "&::before" : { content : 'unset' }
180+ } ,
181+ root : {
182+ display : 'flex' ,
183+ flexDirection : 'column'
184+ }
185+ } )
186+
187+ export default withStyles ( styles ) ( NetPyNECellRule )
0 commit comments