better looking connection editor
This commit is contained in:
parent
8ac5a730cc
commit
d893476d1b
1 changed files with 9 additions and 6 deletions
|
|
@ -464,9 +464,10 @@ function ConnEditor(ast: Statechart, plant: Plant<any>, plantConns: Conns, setPl
|
|||
const scInputs = <>{ast.inputEvents.map(e => <option key={'sc.'+e.event} value={'sc.'+e.event}>sc.{e.event}</option>)}</>;
|
||||
return <>
|
||||
{/* Plant UI events can go to SC or to Plant */}
|
||||
{plant.uiEvents.map(e => <div>
|
||||
<label htmlFor={`select-dst-plant-ui-${e.event}`}>ui.{e.event} → </label>
|
||||
{plant.uiEvents.map(e => <div style={{width:'100%', textAlign:'right'}}>
|
||||
<label htmlFor={`select-dst-plant-ui-${e.event}`} style={{width:'50%'}}>ui.{e.event} → </label>
|
||||
<select id={`select-dst-plant-ui-${e.event}`}
|
||||
style={{width:'50%'}}
|
||||
value={plantConns['plant.ui.'+e.event]?.join('.')}
|
||||
onChange={domEvent => setPlantConns(conns => ({...conns, [`plant.ui.${e.event}`]: domEvent.target.value.split('.') as [string,string]}))}>
|
||||
<option key="none" value=""></option>
|
||||
|
|
@ -476,9 +477,10 @@ function ConnEditor(ast: Statechart, plant: Plant<any>, plantConns: Conns, setPl
|
|||
</div>)}
|
||||
|
||||
{/* SC output events can go to Plant */}
|
||||
{[...ast.outputEvents].map(e => <div>
|
||||
<label htmlFor={`select-dst-sc-${e}`}>sc.{e} → </label>
|
||||
{[...ast.outputEvents].map(e => <div style={{width:'100%', textAlign:'right'}}>
|
||||
<label htmlFor={`select-dst-sc-${e}`} style={{width:'50%'}}>sc.{e} → </label>
|
||||
<select id={`select-dst-sc-${e}`}
|
||||
style={{width:'50%'}}
|
||||
value={plantConns['sc.'+e]?.join('.')}
|
||||
onChange={domEvent => setPlantConns(conns => ({...conns, [`sc.${e}`]: domEvent.target.value.split('.') as [string,string]}))}>
|
||||
<option key="none" value=""></option>
|
||||
|
|
@ -487,9 +489,10 @@ function ConnEditor(ast: Statechart, plant: Plant<any>, plantConns: Conns, setPl
|
|||
</div>)}
|
||||
|
||||
{/* Plant output events can go to Statechart */}
|
||||
{[...plant.outputEvents.map(e => <div>
|
||||
<label htmlFor={`select-dst-plant-${e.event}`}>plant.{e.event} → </label>
|
||||
{[...plant.outputEvents.map(e => <div style={{width:'100%', textAlign:'right'}}>
|
||||
<label htmlFor={`select-dst-plant-${e.event}`} style={{width:'50%'}}>plant.{e.event} → </label>
|
||||
<select id={`select-dst-plant-${e.event}`}
|
||||
style={{width:'50%'}}
|
||||
value={plantConns['plant.'+e.event]?.join('.')}
|
||||
onChange={(domEvent => setPlantConns(conns => ({...conns, [`plant.${e.event}`]: domEvent.target.value.split('.') as [string,string]})))}>
|
||||
<option key="none" value=""></option>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue