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

import { __rest } from "tslib";
/*
 * @Author: codingfly
 * @Description:
 * @Date: 2021-08-04 14:29:13
 * @LastEditTime: 2021-09-08 15:08:29
 * @FilePath: \annar-master\components\box\index.tsx
 */

import React from 'react';
import { View } from 'remax/one';
import classNames from 'classnames';
import { getPrefixCls } from './../common';
import { addUnit } from './../_utils';
var prefixCls = 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 = __rest(props, ["textAlign", "align", "size", "block", "justify", "color", "border", "padding", "margin", "shape", "backgroundColor", "style", "className", "children", "handleTap"]);

  var new_style = {
    fontSize: addUnit(size),
    color: color,
    padding: padding,
    margin: margin,
    backgroundColor: backgroundColor
  };
  var classes = classNames(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.createElement(View, Object.assign({
    className: classes,
    style: new_style,
    onTap: handleTap
  }, restProps), children);
};

export default Box;