|
|
@ -7,9 +7,6 @@ class PropertiesForm extends React.Component { |
|
|
|
render() { |
|
|
|
render() { |
|
|
|
let types = this.props.types; |
|
|
|
let types = this.props.types; |
|
|
|
let value = this.props.value; |
|
|
|
let value = this.props.value; |
|
|
|
if (!value) { |
|
|
|
|
|
|
|
value = {}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <div className='form-properties-form'> |
|
|
|
return <div className='form-properties-form'> |
|
|
|
{ |
|
|
|
{ |
|
|
@ -40,10 +37,6 @@ class PropertiesForm extends React.Component { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bindValue(e) { |
|
|
|
bindValue(e) { |
|
|
|
if (!this.props.onChange) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let name = e.target.name; |
|
|
|
let name = e.target.name; |
|
|
|
let next = { ...this.props.value }; |
|
|
|
let next = { ...this.props.value }; |
|
|
|
if (e.target.type.toLowerCase() === 'checkbox') { |
|
|
|
if (e.target.type.toLowerCase() === 'checkbox') { |
|
|
@ -63,4 +56,9 @@ PropertiesForm.propTypes = { |
|
|
|
onChange: PropTypes.func, |
|
|
|
onChange: PropTypes.func, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PropertiesForm.defaultProps = { |
|
|
|
|
|
|
|
value: {}, |
|
|
|
|
|
|
|
onChange: () => {}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default PropertiesForm; |
|
|
|
export default PropertiesForm; |
|
|
|