"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _icons = require("@ant-design/icons");
var _button = _interopRequireDefault(require("../button"));
var _dropdown = _interopRequireDefault(require("../dropdown"));
var _tooltip = _interopRequireDefault(require("../tooltip"));
var _wauProvider = require("../wau-provider");
var _container = _interopRequireDefault(require("./container"));
var _jsxRuntime = require("react/jsx-runtime");
const DensityIcon = () => {
  // eslint-disable-next-line
  const counter = _container.default.useContainer();
  const intl = (0, _wauProvider.useIntl)();
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_dropdown.default, {
    menu: {
      items: [{
        key: 'large',
        title: intl.getMessage('tableToolBar.densityLarger', '默认'),
        label: intl.getMessage('tableToolBar.densityLarger', '默认')
      }, {
        key: 'middle',
        title: intl.getMessage('tableToolBar.densityMiddle', '中等'),
        label: intl.getMessage('tableToolBar.densityMiddle', '中等')
      }, {
        key: 'small',
        title: intl.getMessage('tableToolBar.densitySmall', '紧凑'),
        label: intl.getMessage('tableToolBar.densitySmall', '紧凑')
      }],
      selectedKeys: [counter.tableSize],
      onClick: ({
        key
      }) => {
        if (counter.setTableSize) {
          counter.setTableSize(key);
        }
      },
      style: {
        width: 80
      }
    },
    trigger: ['click'],
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
      title: intl.getMessage('tableToolBar.density', '表格密度'),
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
        icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ColumnHeightOutlined, {})
      })
    })
  });
};
var _default = /*#__PURE__*/_react.default.memo(DensityIcon);
exports.default = _default;