text: import React from 'react';
  import { Column, CellMeasurer } from 'react-virtualized';
  import DefaultRenderer from '../DefaultRenderer';
  import Spacing from '../../Spacing';
  import { DEFAULT_WIDTH_PROPERTIES } from '../constants';
  export default function renderDataColumns(keys, editMode, onEdit, cache, _ref) {
    let {
      columnMetadata,
      expandable,
      renderers,
      selectable,
      showColumnDividers,
      zebra,
      dynamicRowHeight,
      cx,
      styles,
      theme
    } = _ref;
  
    const renderCell = (key, columnIndex, row) => {
      const {
        metadata
      } = row.rowData;
      const {
        isChild
      } = metadata;
      const customRenderer = renderers && renderers[key];
      const isLeftmost = columnIndex === 0;
      const indentSize = !expandable || !isLeftmost ? 2 : 2.5;
      const spacing = isChild || !((expandable || selectable) && isLeftmost) ? indentSize : 0;
      const rendererArguments = {
        row,
        keyName: key,
        onEdit,
        zebra: zebra || false,
        editMode,
        theme
      };
  
      if (metadata && metadata.colSpanKey && renderers) {
        if (isLeftmost) {
          const colSpanRenderer = renderers[metadata.colSpanKey];
  
          if (colSpanRenderer) {
            return React.createElement(colSpanRenderer, rendererArguments);
          }
        }
      }
  
      const contents = React.createElement(customRenderer || DefaultRenderer, rendererArguments);
      return React.createElement(Spacing, {
        left: spacing,
        right: 2
      }, contents || '');
    };
  
    const columnCellRenderer = columnIdx => row => {
      const {
        dataKey,
        parent,
        rowIndex
      } = row;
      const content = renderCell(dataKey, columnIdx, row);
  
      if (!dynamicRowHeight) {
        return React.createElement("div", {
          className: cx(styles.rowContainer)
        }, React.createElement("div", {
          className: cx(styles.row)
        }, content));
      }
  
      return React.createElement("div", {
        className: cx(styles.rowContainer)
      }, React.createElement(CellMeasurer, {
        key: dataKey,
        cache: cache,
        columnIndex: columnIdx // @ts-ignore We need to pass in the parent node
        ,
        parent: parent,
        rowIndex: rowIndex
      }, React.createElement("div", {
        className: cx(styles.row)
      }, content)));
    };
  
    return keys.map((key, idx) => {
      const widthPropertiesOptions = ['maxWidth', 'minWidth', 'width', 'flexGrow', 'flexShrink'];
      const widthProperties = {};
      widthPropertiesOptions.forEach(property => {
        widthProperties[property] = columnMetadata && columnMetadata[key] !== undefined && columnMetadata[key][property] !== undefined ? columnMetadata[key][property] : DEFAULT_WIDTH_PROPERTIES[property];
      });
      const isRightmost = idx === keys.length - 1;
      return React.createElement(Column, {
        key: key,
        dataKey: key,
        label: key,
        width: widthProperties.width,
        flexGrow: widthProperties.flexGrow,
        flexShrink: widthProperties.flexShrink,
        maxWidth: widthProperties.maxWidth,
        minWidth: widthProperties.minWidth,
        cellRenderer: columnCellRenderer(idx),
        className: cx(styles && styles.column, showColumnDividers && !isRightmost && styles && styles.column_divider)
      });
    });
  }