"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var _box = _interopRequireDefault(require("../box"));

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

var _theme = _interopRequireDefault(require("./theme.css"));

var _uiUtilities = _interopRequireDefault(require("@teamleader/ui-utilities"));

var _excluded = ["align", "backgroundColor", "border", "children", "className", "flex", "preventOverflow", "soft", "strong"];

var Cell = function Cell(_ref) {
  var _cx;

  var _ref$align = _ref.align,
      align = _ref$align === void 0 ? 'left' : _ref$align,
      backgroundColor = _ref.backgroundColor,
      border = _ref.border,
      children = _ref.children,
      className = _ref.className,
      _ref$flex = _ref.flex,
      flex = _ref$flex === void 0 ? 1 : _ref$flex,
      _ref$preventOverflow = _ref.preventOverflow,
      preventOverflow = _ref$preventOverflow === void 0 ? true : _ref$preventOverflow,
      _ref$soft = _ref.soft,
      soft = _ref$soft === void 0 ? false : _ref$soft,
      _ref$strong = _ref.strong,
      strong = _ref$strong === void 0 ? false : _ref$strong,
      others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var classNames = (0, _classnames.default)(_uiUtilities.default['reset-font-smoothing'], _theme.default['cell'], _theme.default["align-".concat(align)], _theme.default["flex-".concat(flex)], _theme.default["has-background-".concat(backgroundColor)], _theme.default["has-border-".concat(border)], (_cx = {}, (0, _defineProperty2.default)(_cx, _theme.default['is-soft'], soft), (0, _defineProperty2.default)(_cx, _theme.default['is-strong'], strong), _cx), className);
  return /*#__PURE__*/_react.default.createElement(_box.default, (0, _extends2.default)({
    className: classNames,
    "data-teamleader-ui": "datagrid-cell",
    boxSizing: "content-box"
  }, others), preventOverflow ? /*#__PURE__*/_react.default.createElement("div", {
    className: _theme.default['has-overflow-prevention']
  }, children) : children);
};

Cell.displayName = 'DataGrid.Cell';
var _default = Cell;
exports.default = _default;