"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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

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

var _popover = _interopRequireDefault(require("../../../../lib/popover"));

var _enum = require("../../button/enum");

var _enum2 = require("../../core/enum");

var _Button = _interopRequireDefault(require("../../button/Button"));

var _tooltip = _interopRequireDefault(require("../../tooltip"));

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

var _localeContext = require("../../locale-context");

var _CustomizationSettings = _interopRequireDefault(require("./CustomizationSettings"));

var ComboCustomizationColumnHeader = function ComboCustomizationColumnHeader() {
  var _useContext = (0, _react.useContext)(_TableContext["default"]),
      prefixCls = _useContext.prefixCls;

  var _useState = (0, _react.useState)(false),
      _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
      visible = _useState2[0],
      setVisible = _useState2[1];

  var handleVisibleChange = function handleVisibleChange() {
    setVisible(!visible);
  };

  return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
    title: (0, _localeContext.$l)('Table', 'field_settings')
  }, /*#__PURE__*/_react["default"].createElement(_popover["default"], {
    trigger: "click",
    placement: "bottomRight",
    overlayClassName: "".concat(prefixCls, "-combo-customization"),
    title: (0, _localeContext.$l)('Table', 'field_settings'),
    content: /*#__PURE__*/_react["default"].createElement(_CustomizationSettings["default"], {
      visible: visible,
      setVisible: setVisible
    }),
    onVisibleChange: handleVisibleChange,
    visible: visible,
    arrowPointAtCenter: true
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    funcType: _enum.FuncType.flat,
    size: _enum2.Size.small,
    icon: "predefine"
  })));
};

ComboCustomizationColumnHeader.displayName = 'ComboCustomizationColumnHeader';

var _default = /*#__PURE__*/(0, _react.memo)(ComboCustomizationColumnHeader);

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