1import React from 'react';
2import PropTypes from 'prop-types';
4import { getDomProps } from '../lib/base'
6const ProtoInput = props => {
9 // getDomProps gets any prop prepended with 'prop-'. Useful here because
10 // one cannot simply pass props like {...props} because the input elem
11 // cannot accept children nodes, which are included in the props arg. It
12 // is doubly useful because it lets the developer control which props are
13 // added to the real DOM.
14 {...getDomProps(props)}
15 className={props.className}
16 onChange={e => props.onChange(e)}
17 onKeyPress={e => props.onKeyPress(e)}
18 onFocus={e => props.onFocus(e)}
19 onBlur={e => props.onBlur(e)}
20 placeholder={props.placeholder}
25 autoFocus={props.autoFocus}
26 readOnly={props.readOnly}
27 maxLength={props.maxLength}
28 autoComplete={props.autoComplete} />
33ProtoInput.propTypes = {
34 disabled: PropTypes.bool,
35 onChange: PropTypes.func,
36 onBlur: PropTypes.func,
37 onFocus: PropTypes.func,
38 onKeyPress: PropTypes.func,
39 className: PropTypes.string,
40 style: PropTypes.object,
41 children: PropTypes.node,
42 autoFocus: PropTypes.bool,
43 readOnly: PropTypes.bool,
44 name: PropTypes.string,
45 value: PropTypes.string,
46 autoComplete: PropTypes.string,
47 type: PropTypes.string,
51ProtoInput.defaultProps = {
67export default ProtoInput;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list