|
|
@ -1,21 +1,14 @@ |
|
|
|
import React, { Component } from 'react' |
|
|
|
import PropTypes from 'prop-types' |
|
|
|
import { inherits } from 'util' |
|
|
|
import React from 'react' |
|
|
|
|
|
|
|
|
|
|
|
export default ReadOnlyInput |
|
|
|
export default function ReadOnlyInput (props) { |
|
|
|
|
|
|
|
|
|
|
|
inherits(ReadOnlyInput, Component) |
|
|
|
|
|
|
|
function ReadOnlyInput () { |
|
|
|
|
|
|
|
Component.call(this) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReadOnlyInput.prototype.render = function ReadOnlyInput () { |
|
|
|
|
|
|
|
const { |
|
|
|
const { |
|
|
|
wrapperClass = '', |
|
|
|
wrapperClass = '', |
|
|
|
inputClass = '', |
|
|
|
inputClass = '', |
|
|
|
value, |
|
|
|
value, |
|
|
|
textarea, |
|
|
|
textarea, |
|
|
|
onClick, |
|
|
|
onClick, |
|
|
|
} = this.props |
|
|
|
} = props |
|
|
|
|
|
|
|
|
|
|
|
const InputType = textarea ? 'textarea' : 'input' |
|
|
|
const InputType = textarea ? 'textarea' : 'input' |
|
|
|
|
|
|
|
|
|
|
@ -32,3 +25,10 @@ ReadOnlyInput.prototype.render = function ReadOnlyInput () { |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReadOnlyInput.propTypes = { |
|
|
|
|
|
|
|
wrapperClass: PropTypes.string, |
|
|
|
|
|
|
|
inputClass: PropTypes.string, |
|
|
|
|
|
|
|
value: PropTypes.string, |
|
|
|
|
|
|
|
textarea: PropTypes.bool, |
|
|
|
|
|
|
|
onClick: PropTypes.func, |
|
|
|
|
|
|
|
} |
|
|
|