123 |
- import React from'react';import ExtendableContainer from'../../base/ExtendableContainer';import InputField from'../../base/InputField';import Logger from'../../../systems/Logger';import Module from'../../Module';import ModuleSystem from'../../../systems/ModuleSystem';//import './ParameterControl.css';
- class ModuleCreation extends Module{constructor(a){super(a),this.state={},this.model=this.createInputs(a.inputs)}render(){return React.createElement('div',null)}}class ParameterControl extends Module{constructor(a){super(a),this.state={},this.model=this.createInputs(this.props.module.Inputs)}createInputs(a){let b=[];for(let c in a){let d=a[c];this.state[c]=d.defaultValue,b.push(React.createElement(InputField,{name:c,metadata:d,key:c,onChange:a=>this.setState({[c]:a})}))}return b}createInstance(a){a&&a.preventDefault();let b={};for(var c in this.state)b[c]={name:c,value:this.state[c]};let d={ctor:this.props.module.name,children:[],id:'123',//random
- inputs:b,outputs:{}};return d}render(){let a=Module.OutputMarker,b=React.createElement(a,{module:this.createInstance(),text:this.props.module.name});return React.createElement('div',{className:this.props.className+' ParameterControl'},b)}}export default ParameterControl;
|