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

/*
Copyright (c) 2018-2019 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import { styled } from '../styles/index.js';
var StyledTableElement = 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";
export 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
});
StyledTable.__STYLETRON__ = StyledTableElement.__STYLETRON__;
StyledTable.displayName = 'StyledTable';
var StyledHeadElement = 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";
export 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
);
StyledHead.__STYLETRON__ = StyledHeadElement.__STYLETRON__;
StyledHead.displayName = 'StyledHead';
var StyledHeadCellElement = 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";
export 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
  ;
});
StyledHeadCell.__STYLETRON__ = StyledHeadCellElement.__STYLETRON__;
StyledHeadCell.displayName = 'StyledHeadCell';
export var StyledSortableLabel = 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
    }
  });
});
StyledSortableLabel.displayName = "StyledSortableLabel";
var StyledBodyElement = 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";
export 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
);
StyledBody.__STYLETRON__ = StyledBodyElement.__STYLETRON__;
StyledBody.displayName = 'StyledBody';
var StyledRowElement = styled('div', {
  display: 'flex',
  alignItems: 'center'
}); // eslint-disable-next-line flowtype/no-weak-types

StyledRowElement.displayName = "StyledRowElement";
export 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
  ;
});
StyledRow.__STYLETRON__ = StyledRowElement.__STYLETRON__;
StyledRow.displayName = 'StyledRow';
var StyledCellElement = 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";
export 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
);
StyledCell.__STYLETRON__ = StyledCellElement.__STYLETRON__;
StyledCell.displayName = 'StyledCell';
export var StyledFilterButton = styled('button', {
  backgroundColor: 'transparent',
  border: 'none',
  paddingTop: 'none',
  paddingRight: 'none',
  paddingBottom: 'none',
  paddingLeft: 'none'
});
StyledFilterButton.displayName = "StyledFilterButton";
export var StyledFilterContent = 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'
  });
});
StyledFilterContent.displayName = "StyledFilterContent";
export var StyledFilterHeading = 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
  });
});
StyledFilterHeading.displayName = "StyledFilterHeading";
export var StyledFilterFooter = 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'
  };
});
StyledFilterFooter.displayName = "StyledFilterFooter";
export var StyledAction = 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'
    }
  };
});
StyledAction.displayName = "StyledAction";