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";
var __rest = this && this.__rest || function (s, e) {
    var t = {};
    for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
    }if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
        if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
    }
    return t;
};
import React, { Component } from "react";
import AntdTreeSelect from "antd/es/tree-select";
import PagePoint from "../page-point/pagePointEnhanced";
import { ConfigConsumer } from "../config-provider";
import "antd/es/tree-select/style";
var TreeNode = AntdTreeSelect.TreeNode,
    SHOW_ALL = AntdTreeSelect.SHOW_ALL,
    SHOW_PARENT = AntdTreeSelect.SHOW_PARENT,
    SHOW_CHILD = AntdTreeSelect.SHOW_CHILD;

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

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

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

    _createClass(FdxTreeSelect, [{
        key: "render",
        value: function render() {
            var _a = this.props,
                forwardedRef = _a.forwardedRef,
                rest = __rest(_a, ["forwardedRef"]);
            return React.createElement(AntdTreeSelect, _extends({ ref: forwardedRef }, rest));
        }
    }]);

    return FdxTreeSelect;
}(Component);

var TreeSelect = React.forwardRef(function (props, ref) {
    return React.createElement(
        ConfigConsumer,
        null,
        function (_ref) {
            var pagePoint = _ref.pagePoint;
            return pagePoint ? React.createElement(PagePoint, _extends({ compType: "TreeSelect" }, props, { render: function render(eventprops) {
                    return React.createElement(FdxTreeSelect, _extends({}, props, { forwardedRef: ref }, eventprops, { "data-ui-role": "TreeSelect" }));
                } })) : React.createElement(FdxTreeSelect, _extends({}, props, { forwardedRef: ref }));
        }
    );
});
TreeSelect.TreeNode = TreeNode;
TreeSelect.SHOW_ALL = SHOW_ALL;
TreeSelect.SHOW_PARENT = SHOW_PARENT;
TreeSelect.SHOW_CHILD = SHOW_CHILD;
export default TreeSelect;