import _extends from "babel-runtime/helpers/extends";
import _classCallCheck from "babel-runtime/helpers/classCallCheck";
import _createClass from "babel-runtime/helpers/createClass";
import _possibleConstructorReturn from "babel-runtime/helpers/possibleConstructorReturn";
import _inherits from "babel-runtime/helpers/inherits";
import React, { Component } from "react";
import AntdTree from "antd/es/tree";
import PagePoint from "../page-point/pagePointEnhanced";
import { ConfigConsumer } from "../config-provider";
import "antd/es/tree/style";
var TreeNode = AntdTree.TreeNode,
    DirectoryTree = AntdTree.DirectoryTree;

var Tree = function (_Component) {
    _inherits(Tree, _Component);

    function Tree() {
        _classCallCheck(this, Tree);

        return _possibleConstructorReturn(this, (Tree.__proto__ || Object.getPrototypeOf(Tree)).apply(this, arguments));
    }

    _createClass(Tree, [{
        key: "render",
        value: function render() {
            var _this2 = this;

            return React.createElement(
                ConfigConsumer,
                null,
                function (_ref) {
                    var pagePoint = _ref.pagePoint;
                    return pagePoint ? React.createElement(PagePoint, _extends({ compType: "Tree" }, _this2.props, { render: function render(eventprops) {
                            return React.createElement(AntdTree, _extends({}, _this2.props, eventprops, { "data-ui-role": "Tree" }));
                        } })) : React.createElement(AntdTree, _this2.props);
                }
            );
        }
    }]);

    return Tree;
}(Component);

export default Tree;

Tree.TreeNode = TreeNode;
Tree.DirectoryTree = DirectoryTree;