1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 |
|
7 | var _class, _temp;
|
8 |
|
9 | import React, { Component } from 'react';
|
10 | import { findDOMNode } from 'react-dom';
|
11 | import PropTypes from 'prop-types';
|
12 | import Input from '../../input';
|
13 |
|
14 | var TreeNodeInput = (_temp = _class = function (_Component) {
|
15 | _inherits(TreeNodeInput, _Component);
|
16 |
|
17 | function TreeNodeInput() {
|
18 | _classCallCheck(this, TreeNodeInput);
|
19 |
|
20 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
21 | }
|
22 |
|
23 | TreeNodeInput.prototype.componentDidMount = function componentDidMount() {
|
24 | var inputWrapperNode = findDOMNode(this);
|
25 | inputWrapperNode.querySelector('input').focus();
|
26 | };
|
27 |
|
28 | TreeNodeInput.prototype.render = function render() {
|
29 | var _props = this.props,
|
30 | prefix = _props.prefix,
|
31 | others = _objectWithoutProperties(_props, ['prefix']);
|
32 |
|
33 | return React.createElement(Input, _extends({
|
34 | size: 'small',
|
35 | className: prefix + 'tree-node-input'
|
36 | }, others));
|
37 | };
|
38 |
|
39 | return TreeNodeInput;
|
40 | }(Component), _class.propTypes = {
|
41 | prefix: PropTypes.string
|
42 | }, _temp);
|
43 | TreeNodeInput.displayName = 'TreeNodeInput';
|
44 | export { TreeNodeInput as default }; |
\ | No newline at end of file |