'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports["default"] = exports.AntTreeNode = undefined;

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var React = _interopRequireWildcard(_react);

var _rcTree = require('rc-tree');

var _rcTree2 = _interopRequireDefault(_rcTree);

var _openAnimation = require('../_util/openAnimation');

var _openAnimation2 = _interopRequireDefault(_openAnimation);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var AntTreeNode = exports.AntTreeNode = function (_React$Component) {
    (0, _inherits3["default"])(AntTreeNode, _React$Component);

    function AntTreeNode() {
        (0, _classCallCheck3["default"])(this, AntTreeNode);
        return (0, _possibleConstructorReturn3["default"])(this, _React$Component.apply(this, arguments));
    }

    AntTreeNode.prototype.render = function render() {
        return React.createElement(AntTreeNode, this.props);
    };

    return AntTreeNode;
}(React.Component);

var Tree = function (_React$Component2) {
    (0, _inherits3["default"])(Tree, _React$Component2);

    function Tree() {
        (0, _classCallCheck3["default"])(this, Tree);
        return (0, _possibleConstructorReturn3["default"])(this, _React$Component2.apply(this, arguments));
    }

    Tree.prototype.render = function render() {
        var props = this.props;
        var checkable = props.checkable;
        return React.createElement(
            _rcTree2["default"],
            (0, _extends3["default"])({}, props, { checkable: checkable ? React.createElement('span', { className: props.prefixCls + '-checkbox-inner' }) : checkable }),
            this.props.children
        );
    };

    return Tree;
}(React.Component);

exports["default"] = Tree;

Tree.TreeNode = _rcTree.TreeNode;
Tree.defaultProps = {
    prefixCls: 'ant-tree',
    checkable: false,
    showIcon: false,
    openAnimation: _openAnimation2["default"]
};