"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StyledAction = exports.StyledFilterFooter = exports.StyledFilterHeading = exports.StyledFilterContent = exports.StyledFilterButton = exports.StyledCell = exports.StyledRow = exports.StyledBody = exports.StyledSortableLabel = exports.StyledHeadCell = exports.StyledHead = exports.StyledTable = void 0;

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

var _index = require("../styles/index.js");

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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 _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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

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 StyledTableElement = (0, _index.styled)('div', function (_ref) {
  var $theme = _ref.$theme;
  return _objectSpread({}, $theme.borders.border300, {
    backgroundColor: $theme.colors.tableBackground,
    borderTopLeftRadius: $theme.borders.radius200,
    borderTopRightRadius: $theme.borders.radius200,
    borderBottomRightRadius: $theme.borders.radius200,
    borderBottomLeftRadius: $theme.borders.radius200,
    display: 'flex',
    flexDirection: 'column',
    height: '100%',
    overflowX: 'scroll'
  });
}); // eslint-disable-next-line flowtype/no-weak-types

StyledTableElement.displayName = "StyledTableElement";
var StyledTable = React.forwardRef(function (props, ref) {
  return React.createElement(StyledTableElement, _extends({
    ref: ref,
    "data-baseweb": "table-custom",
    role: "grid"
  }, props)); // eslint-disable-next-line flowtype/no-weak-types
});
exports.StyledTable = StyledTable;
StyledTable.__STYLETRON__ = StyledTableElement.__STYLETRON__;
StyledTable.displayName = 'StyledTable';
var StyledHeadElement = (0, _index.styled)('div', function (_ref2) {
  var $theme = _ref2.$theme,
      $width = _ref2.$width;
  return {
    backgroundColor: $theme.colors.tableHeadBackgroundColor,
    boxShadow: $theme.lighting.shadow400,
    display: 'flex',
    flexGrow: 0,
    width: $width ? $width : '100%'
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledHeadElement.displayName = "StyledHeadElement";
var StyledHead = React.forwardRef(function (props, ref) {
  return React.createElement(StyledHeadElement, _extends({
    ref: ref,
    role: "row"
  }, props));
} // eslint-disable-next-line flowtype/no-weak-types
);
exports.StyledHead = StyledHead;
StyledHead.__STYLETRON__ = StyledHeadElement.__STYLETRON__;
StyledHead.displayName = 'StyledHead';
var StyledHeadCellElement = (0, _index.styled)('div', function (_ref3) {
  var $theme = _ref3.$theme,
      $cursor = _ref3.$cursor;
  return _objectSpread({}, $theme.typography.font350, {}, $theme.borders.border300, {
    borderTop: 'none',
    borderBottom: 'none',
    borderLeft: 'none',
    color: $theme.colors.colorPrimary,
    display: 'flex',
    justifyContent: 'space-between',
    paddingTop: $theme.sizing.scale500,
    paddingRight: $theme.sizing.scale600,
    paddingBottom: $theme.sizing.scale500,
    paddingLeft: $theme.sizing.scale600,
    cursor: $cursor ? $cursor : 'inherit',
    width: '100%',
    ':last-of-type': {
      borderRight: 'none'
    }
  });
}); // eslint-disable-next-line flowtype/no-weak-types

StyledHeadCellElement.displayName = "StyledHeadCellElement";
var StyledHeadCell = React.forwardRef(function (props, ref) {
  return React.createElement(StyledHeadCellElement, _extends({
    ref: ref,
    role: "columnheader"
  }, props)) // eslint-disable-next-line flowtype/no-weak-types
  ;
});
exports.StyledHeadCell = StyledHeadCell;
StyledHeadCell.__STYLETRON__ = StyledHeadCellElement.__STYLETRON__;
StyledHeadCell.displayName = 'StyledHeadCell';
var StyledSortableLabel = (0, _index.styled)('button', function (_ref4) {
  var $theme = _ref4.$theme;
  return _objectSpread({}, $theme.typography.font250, {
    alignItems: 'center',
    backgroundColor: 'transparent',
    border: 'none',
    color: $theme.colors.colorPrimary,
    display: 'flex',
    padding: 0,
    ':hover:enabled': {
      cursor: 'pointer'
    },
    ':disabled': {
      color: $theme.colors.mono500
    }
  });
});
exports.StyledSortableLabel = StyledSortableLabel;
StyledSortableLabel.displayName = "StyledSortableLabel";
var StyledBodyElement = (0, _index.styled)('div', function (_ref5) {
  var $width = _ref5.$width;
  return {
    width: $width ? $width : '100%',
    overflowX: 'hidden',
    overflowY: 'overlay',
    flex: 1
  };
}); // eslint-disable-next-line flowtype/no-weak-types

StyledBodyElement.displayName = "StyledBodyElement";
var StyledBody = React.forwardRef(function (props, ref) {
  return React.createElement(StyledBodyElement, _extends({
    ref: ref,
    role: "rowgroup"
  }, props));
} // eslint-disable-next-line flowtype/no-weak-types
);
exports.StyledBody = StyledBody;
StyledBody.__STYLETRON__ = StyledBodyElement.__STYLETRON__;
StyledBody.displayName = 'StyledBody';
var StyledRowElement = (0, _index.styled)('div', {
  display: 'flex',
  alignItems: 'center'
}); // eslint-disable-next-line flowtype/no-weak-types

StyledRowElement.displayName = "StyledRowElement";
var StyledRow = React.forwardRef(function (props, ref) {
  return React.createElement(StyledRowElement, _extends({
    ref: ref,
    role: "row"
  }, props)) // eslint-disable-next-line flowtype/no-weak-types
  ;
});
exports.StyledRow = StyledRow;
StyledRow.__STYLETRON__ = StyledRowElement.__STYLETRON__;
StyledRow.displayName = 'StyledRow';
var StyledCellElement = (0, _index.styled)('div', function (_ref6) {
  var $theme = _ref6.$theme,
      $striped = _ref6.$striped;
  return _objectSpread({}, $theme.typography.font200, {
    backgroundColor: $striped ? $theme.colors.tableStripedBackground : null,
    color: $theme.colors.colorPrimary,
    display: 'flex',
    flex: 1,
    paddingTop: $theme.sizing.scale300,
    paddingRight: $theme.sizing.scale600,
    paddingBottom: $theme.sizing.scale300,
    paddingLeft: $theme.sizing.scale600
  });
}); // eslint-disable-next-line flowtype/no-weak-types

StyledCellElement.displayName = "StyledCellElement";
var StyledCell = React.forwardRef(function (props, ref) {
  return React.createElement(StyledCellElement, _extends({
    ref: ref,
    role: "gridcell"
  }, props));
} // eslint-disable-next-line flowtype/no-weak-types
);
exports.StyledCell = StyledCell;
StyledCell.__STYLETRON__ = StyledCellElement.__STYLETRON__;
StyledCell.displayName = 'StyledCell';
var StyledFilterButton = (0, _index.styled)('button', {
  backgroundColor: 'transparent',
  border: 'none',
  paddingTop: 'none',
  paddingRight: 'none',
  paddingBottom: 'none',
  paddingLeft: 'none'
});
exports.StyledFilterButton = StyledFilterButton;
StyledFilterButton.displayName = "StyledFilterButton";
var StyledFilterContent = (0, _index.styled)('div', function (_ref7) {
  var $theme = _ref7.$theme;
  return _objectSpread({}, $theme.borders.border300, {
    backgroundColor: $theme.colors.tableFilterBackground,
    borderRight: 'none',
    borderLeft: 'none',
    maxHeight: '196px',
    paddingRight: $theme.sizing.scale600,
    paddingLeft: $theme.sizing.scale600,
    overflow: 'auto'
  });
});
exports.StyledFilterContent = StyledFilterContent;
StyledFilterContent.displayName = "StyledFilterContent";
var StyledFilterHeading = (0, _index.styled)('div', function (_ref8) {
  var $theme = _ref8.$theme;
  return _objectSpread({}, $theme.typography.font250, {
    color: $theme.colors.tableFilterHeading,
    paddingTop: $theme.sizing.scale500,
    paddingRight: $theme.sizing.scale600,
    paddingBottom: $theme.sizing.scale500,
    paddingLeft: $theme.sizing.scale600
  });
});
exports.StyledFilterHeading = StyledFilterHeading;
StyledFilterHeading.displayName = "StyledFilterHeading";
var StyledFilterFooter = (0, _index.styled)('div', function (_ref9) {
  var $theme = _ref9.$theme;
  return {
    backgroundColor: $theme.colors.tableFilterFooterBackground,
    paddingTop: $theme.sizing.scale300,
    paddingRight: $theme.sizing.scale100,
    paddingBottom: $theme.sizing.scale300,
    paddingLeft: $theme.sizing.scale100,
    display: 'flex',
    justifyContent: 'space-between',
    minWidth: '216px'
  };
});
exports.StyledFilterFooter = StyledFilterFooter;
StyledFilterFooter.displayName = "StyledFilterFooter";
var StyledAction = (0, _index.styled)('button', function (_ref10) {
  var $theme = _ref10.$theme;
  return {
    backgroundColor: 'transparent',
    border: 'none',
    color: $theme.colors.primary,
    paddingTop: 0,
    paddingRight: 0,
    paddingBottom: 0,
    paddingLeft: 0,
    marginRight: $theme.sizing.scale100,
    marginLeft: $theme.sizing.scale100,
    ':hover:enabled': {
      cursor: 'pointer'
    }
  };
});
exports.StyledAction = StyledAction;
StyledAction.displayName = "StyledAction";