"use strict";

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

var _tslib = require("tslib");

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

var _one = require("remax/one");

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

var _common = require("./../common");

var _utils = require("./../_utils");

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

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; }

var prefixCls = (0, _common.getPrefixCls)('box');

var Box = function Box(props) {
  var _classNames;

  var _props$textAlign = props.textAlign,
      textAlign = _props$textAlign === void 0 ? 'left' : _props$textAlign,
      _props$align = props.align,
      align = _props$align === void 0 ? 'left' : _props$align,
      _props$size = props.size,
      size = _props$size === void 0 ? '28px' : _props$size,
      block = props.block,
      justify = props.justify,
      color = props.color,
      border = props.border,
      padding = props.padding,
      margin = props.margin,
      shape = props.shape,
      backgroundColor = props.backgroundColor,
      style = props.style,
      className = props.className,
      children = props.children,
      handleTap = props.handleTap,
      restProps = (0, _tslib.__rest)(props, ["textAlign", "align", "size", "block", "justify", "color", "border", "padding", "margin", "shape", "backgroundColor", "style", "className", "children", "handleTap"]);
  var new_style = {
    fontSize: (0, _utils.addUnit)(size),
    color: color,
    padding: padding,
    margin: margin,
    backgroundColor: backgroundColor
  };
  var classes = (0, _classnames.default)(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-block-").concat(block), block), _defineProperty(_classNames, "".concat(prefixCls, "-border"), border), _defineProperty(_classNames, "".concat(prefixCls, "-text-").concat(textAlign), textAlign), _defineProperty(_classNames, "".concat(prefixCls, "-shape"), shape), _defineProperty(_classNames, "".concat(prefixCls, "-align-").concat(align), align), _defineProperty(_classNames, "".concat(prefixCls, "-justify-").concat(justify), justify), _classNames));
  return /*#__PURE__*/_react.default.createElement(_one.View, Object.assign({
    className: classes,
    style: new_style,
    onTap: handleTap
  }, restProps), children);
};

var _default = Box;
exports.default = _default;