"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

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

require("@parallel-line/common/es/common/access/style");

var _access = _interopRequireDefault(require("@parallel-line/common/es/common/access"));

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

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

var _configProvider = _interopRequireDefault(require("../config-provider"));

var _button = _interopRequireDefault(require("antd/es/button"));

var _excluded = ["prefixCls", "className", "color", "code"];

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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 InlineButton = function InlineButton(props) {
  var _React$useContext = React.useContext(_configProvider.default.Context),
      getPrefixCls = _React$useContext.getPrefixCls;

  var customizePrefixCls = props.prefixCls,
      className = props.className,
      color = props.color,
      code = props.code,
      otherProps = _objectWithoutProperties(props, _excluded);

  var prefixCls = getPrefixCls('button', customizePrefixCls);
  return /*#__PURE__*/React.createElement(_access.default, {
    code: code
  }, /*#__PURE__*/React.createElement(_button.default, Object.assign({}, otherProps, {
    className: (0, _classnames.default)(className, color && "".concat(prefixCls, "-").concat(color)),
    prefixCls: prefixCls
  })));
};

InlineButton.defaultProps = {
  type: 'default',
  size: 'middle',
  loading: false,
  disabled: false,
  danger: false,
  block: false,
  ghost: false
};

var Group = function Group(props) {
  return /*#__PURE__*/React.createElement(_button.default.Group, Object.assign({}, props, {
    prefixCls: "".concat(props.prefixCls, "-button-group")
  }));
};

exports.Group = Group;
Group.defaultProps = {
  prefixCls: 'pxx'
};
var _default = InlineButton;
exports.default = _default;