"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireWildcard(require("react"));

var _mobxReactLite = require("mobx-react-lite");

var _reactBeautifulDnd = require("react-beautiful-dnd");

var _TableContext = _interopRequireDefault(require("../../TableContext"));

var Tree = function Tree(props) {
  var children = props.children,
      value = props.value;

  var _useContext = (0, _react.useContext)(_TableContext["default"]),
      prefixCls = _useContext.prefixCls,
      _useContext$columnsDr = _useContext.columnsDragRender,
      columnsDragRender = _useContext$columnsDr === void 0 ? {} : _useContext$columnsDr,
      columnDraggable = _useContext.tableStore.columnDraggable;

  var droppableProps = columnsDragRender.droppableProps,
      renderClone = columnsDragRender.renderClone;
  return columnDraggable ? /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.Droppable, (0, _extends2["default"])({
    droppableId: "tree__--__".concat(value),
    key: "tree",
    renderClone: renderClone ? function (provided, snapshot, rubric) {
      return renderClone({
        provided: provided,
        snapshot: snapshot,
        rubric: rubric
      });
    } : undefined
  }, droppableProps), function (droppableProvided) {
    return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
      ref: droppableProvided.innerRef,
      className: "".concat(prefixCls, "-combo-customization-tree")
    }, droppableProvided && droppableProvided.droppableProps), children, droppableProvided && droppableProvided.placeholder);
  }) : /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-combo-customization-tree")
  }, children);
};

Tree.displayName = 'Tree';

var _default = (0, _mobxReactLite.observer)(Tree);

exports["default"] = _default;
//# sourceMappingURL=Tree.js.map
