export default function buildTableProps(props) {
  var loading = props.loading,
    dataSource = props.dataSource,
    onSort = props.onSort,
    emptyContent = props.emptyContent,
    onFilter = props.onFilter,
    cellProps = props.cellProps,
    rowProps = props.rowProps,
    primaryKey = props.primaryKey,
    theme = props.theme,
    hasHeader = props.hasHeader,
    fixedHeader = props.fixedHeader,
    maxBodyHeight = props.maxBodyHeight,
    stickyHeader = props.stickyHeader,
    isTree = props.isTree,
    indent = props.indent,
    onRowClick = props.onRowClick,
    onRowMouseEnter = props.onRowMouseEnter,
    onRowMouseLeave = props.onRowMouseLeave,
    onResizeChange = props.onResizeChange,
    width = props.width,
    height = props.height,
    loadingComponent = props.loadingComponent,
    hasExpandedRowCtrl = props.hasExpandedRowCtrl,
    expandedRowRender = props.expandedRowRender,
    onRowOpen = props.onRowOpen,
    expandedRowIndent = props.expandedRowIndent,
    useVirtual = props.useVirtual,
    offsetTop = props.offsetTop,
    sort = props.sort,
    sortIcons = props.sortIcons,
    showRowSelector = props.showRowSelector,
    onSelect = props.onSelect,
    onSelectAll = props.onSelectAll,
    isRowSelectorDisabled = props.isRowSelectorDisabled,
    rowSelector = props.rowSelector,
    size = props.size,
    expandedIndexSimulate = props.expandedIndexSimulate,
    rowSelection = props.rowSelection;
  var tableProps = {
    size: size,
    primaryKey: primaryKey || 'id',
    dataSource: dataSource || [],
    hasBorder: theme === 'border',
    hasHeader: hasHeader,
    isZebra: theme === 'zebra',
    loading: loading,
    emptyContent: emptyContent,
    cellProps: cellProps,
    rowProps: rowProps,
    onFilter: onFilter,
    fixedHeader: fixedHeader,
    maxBodyHeight: maxBodyHeight,
    stickyHeader: stickyHeader,
    offsetTop: offsetTop,
    isTree: isTree,
    indent: indent,
    useVirtual: useVirtual,
    onRowClick: onRowClick,
    onRowMouseEnter: onRowMouseEnter,
    onRowMouseLeave: onRowMouseLeave,
    onResizeChange: onResizeChange,
    sort: sort,
    sortIcons: sortIcons,
    onSort: onSort,
    loadingComponent: loadingComponent,
    hasExpandedRowCtrl: hasExpandedRowCtrl,
    expandedRowRender: expandedRowRender,
    onRowOpen: onRowOpen,
    expandedRowIndent: expandedRowIndent,
    style: {
      width: width,
      height: height
    },
    expandedIndexSimulate: expandedIndexSimulate
  };
  if ('openRowKeys' in props) {
    tableProps.openRowKeys = props.openRowKeys;
  }
  if (showRowSelector) {
    var selection;
    if (rowSelection) {
      selection = rowSelection;
    } else {
      selection = {};
      if (onSelect) {
        selection.onSelect = onSelect;
      }
      if (onSelectAll) {
        selection.onSelectAll = onSelectAll;
      }
      selection.mode = rowSelector === 'checkboxSelector' ? 'multiple' : 'single';
      if (isRowSelectorDisabled) {
        var isRowSelectorDisabledFunc = isRowSelectorDisabled;
        selection.getProps = function (rowData, index) {
          return {
            disabled: isRowSelectorDisabledFunc(rowData, index)
          };
        };
      }
    }
    tableProps.rowSelection = selection;
  }
  return tableProps;
}