"use strict";

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

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

var _name = _interopRequireDefault(require("./name"));

var _department = _interopRequireDefault(require("./department"));

var _group = _interopRequireDefault(require("./group"));

var _timer = _interopRequireDefault(require("./timer"));

var _modular = _interopRequireDefault(require("./modular"));

require("./index.css");

var _excluded = ["parmas", "setParma", "setType", "departProps", "nameProps", "filterPanes"];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var preCls = 'filter-buttons';

var FilterButton = function FilterButton(_ref) {
  var parmas = _ref.parmas,
      setParma = _ref.setParma,
      setType = _ref.setType,
      departProps = _ref.departProps,
      nameProps = _ref.nameProps,
      _ref$filterPanes = _ref.filterPanes,
      filterPanes = _ref$filterPanes === void 0 ? {
    department: true,
    timer: true
  } : _ref$filterPanes,
      restProps = _objectWithoutProperties(_ref, _excluded);

  var _filterPanes$departme = filterPanes.department,
      department = _filterPanes$departme === void 0 ? false : _filterPanes$departme,
      _filterPanes$timer = filterPanes.timer,
      timer = _filterPanes$timer === void 0 ? false : _filterPanes$timer,
      _filterPanes$group = filterPanes.group,
      group = _filterPanes$group === void 0 ? false : _filterPanes$group,
      _filterPanes$modular = filterPanes.modular,
      modular = _filterPanes$modular === void 0 ? false : _filterPanes$modular,
      _filterPanes$name = filterPanes.name,
      name = _filterPanes$name === void 0 ? false : _filterPanes$name;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls)
  }, name && /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "-item")
  }, /*#__PURE__*/_react["default"].createElement(_name["default"], _extends({
    setParma: setParma
  }, nameProps, restProps))), department && /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "-item")
  }, /*#__PURE__*/_react["default"].createElement(_department["default"], _extends({
    setParma: setParma
  }, departProps, restProps))), group && /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "-item")
  }, /*#__PURE__*/_react["default"].createElement(_group["default"], _extends({
    setParma: setParma
  }, restProps))), timer && /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "-item")
  }, /*#__PURE__*/_react["default"].createElement(_timer["default"], _extends({
    setParma: setParma,
    parmas: parmas,
    setType: setType
  }, restProps))), modular && /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "-item")
  }, /*#__PURE__*/_react["default"].createElement(_modular["default"], _extends({
    setParma: setParma
  }, restProps))));
};

var _default = FilterButton;
exports["default"] = _default;