"use strict";

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

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

var _classnames = _interopRequireDefault(require("classnames"));

var _getLocale = require("../../../utils/getLocale");

require("./index.css");

var _excluded = ["type", "children", "size", "disable", "className"];

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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

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 = "tita-button";

var Button = function Button(_ref) {
  var _classNames;

  var _ref$type = _ref.type,
      type = _ref$type === void 0 ? "default" : _ref$type,
      _ref$children = _ref.children,
      children = _ref$children === void 0 ? (0, _getLocale.getLocale)("OKR_MyO_Butt_Determine") : _ref$children,
      _ref$size = _ref.size,
      size = _ref$size === void 0 ? "middle" : _ref$size,
      _ref$disable = _ref.disable,
      disable = _ref$disable === void 0 ? false : _ref$disable,
      _ref$className = _ref.className,
      className = _ref$className === void 0 ? "" : _ref$className,
      restProps = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/_react["default"].createElement("div", _extends({
    className: (0, _classnames["default"])((_classNames = {}, _defineProperty(_classNames, "".concat(preCls, "-primary"), type === "primary"), _defineProperty(_classNames, "".concat(preCls, "-default"), type === "default"), _defineProperty(_classNames, "".concat(preCls, "--disabled"), disable), _classNames), "".concat(preCls, "-").concat(size), className)
  }, restProps), children);
};

Button.defaultProps = {
  type: "default",
  children: (0, _getLocale.getLocale)("OKR_MyO_Butt_Determine"),
  size: "middle",
  disable: false,
  className: ""
};
var _default = Button;
exports["default"] = _default;