'use strict';

var _extends = require('@babel/runtime/helpers/extends');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
var pick = require('../../../node_modules/lodash-es/pick.js');
require('core-js/modules/es.symbol.js');
require('core-js/modules/es.array.concat.js');
require('core-js/modules/es.array.filter.js');
require('core-js/modules/es.array.find.js');
require('core-js/modules/es.array.includes.js');
require('core-js/modules/es.array.iterator.js');
require('core-js/modules/es.array.map.js');
require('core-js/modules/es.object.get-own-property-descriptor.js');
require('core-js/modules/es.object.get-own-property-descriptors.js');
require('core-js/modules/es.object.keys.js');
require('core-js/modules/es.object.to-string.js');
require('core-js/modules/es.set.js');
require('core-js/modules/es.string.includes.js');
require('core-js/modules/es.string.iterator.js');
require('core-js/modules/web.dom-collections.for-each.js');
require('core-js/modules/web.dom-collections.iterator.js');
var React = require('react');
var PropTypes = require('prop-types');
var useVisibilityObserver = require('../../../hooks/useVisibilityObserver.js');
var SharedPropTypes = require('../../../constants/SharedPropTypes.js');
var TablePropTypes = require('../TablePropTypes.js');
var TableBodyRow = require('./TableBodyRow/TableBodyRow.js');
var TableBodyLoadMoreRow = require('./TableBodyLoadMoreRow/TableBodyLoadMoreRow.js');
var SkeletonRow = require('./SkeletonRow.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _extends__default = /*#__PURE__*/_interopDefault(_extends);
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray);
var React__default = /*#__PURE__*/_interopDefault(React);
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var propTypes = {
  /** The unique id of the table */
  tableId: PropTypes__default.default.string.isRequired,
  expandedRows: TablePropTypes.ExpandedRowsPropTypes,
  columns: TablePropTypes.TableColumnsPropTypes,
  expandedIds: PropTypes__default.default.arrayOf(PropTypes__default.default.string),
  selectedIds: PropTypes__default.default.arrayOf(PropTypes__default.default.string),
  /** internationalized label */
  selectRowAria: PropTypes__default.default.string,
  /** internationalized label */
  overflowMenuAria: PropTypes__default.default.string,
  /** internationalized label */
  clickToExpandAria: PropTypes__default.default.string,
  /** internationalized label */
  clickToCollapseAria: PropTypes__default.default.string,
  /** I18N label for in progress */
  inProgressText: PropTypes__default.default.string,
  /** I18N label for action failed */
  actionFailedText: PropTypes__default.default.string,
  /** I18N label for learn more */
  learnMoreText: PropTypes__default.default.string,
  /** I18N label for dismiss */
  dismissText: PropTypes__default.default.string,
  /** I18N label for load more */
  loadMoreText: PropTypes__default.default.string,
  /** I18N label for drag handle tooltip */
  dragHandleTooltip: PropTypes__default.default.string,
  /** If a drag is currently in progress */
  isDragging: PropTypes__default.default.bool,
  /** since some columns might not be currently visible */
  totalColumns: PropTypes__default.default.number,
  hasRowSelection: PropTypes__default.default.oneOf(['multi', 'single', false]),
  /** show radio button on single selection */
  useRadioButtonSingleSelect: PropTypes__default.default.bool,
  hasRowExpansion: PropTypes__default.default.bool,
  hasRowNesting: PropTypes__default.default.oneOfType([PropTypes__default.default.bool, PropTypes__default.default.shape({
    /** If the hierarchy only has 1 nested level of children */
    hasSingleNestedHierarchy: PropTypes__default.default.bool
  })]),
  hasRowActions: PropTypes__default.default.bool,
  wrapCellText: SharedPropTypes.WrapCellTextPropTypes.isRequired,
  truncateCellText: PropTypes__default.default.bool.isRequired,
  /** the current state of the row actions */
  rowActionsState: TablePropTypes.RowActionsStatePropTypes,
  shouldExpandOnRowClick: PropTypes__default.default.bool,
  shouldLazyRender: PropTypes__default.default.bool,
  locale: PropTypes__default.default.string,
  actions: PropTypes__default.default.shape({
    onRowClicked: PropTypes__default.default.func,
    onRowSelected: PropTypes__default.default.func,
    onApplyRowActions: PropTypes__default.default.func,
    onRowExpanded: PropTypes__default.default.func,
    onRowLoadMore: PropTypes__default.default.func
  }).isRequired,
  /** What column ordering is currently applied to the table */
  ordering: PropTypes__default.default.arrayOf(PropTypes__default.default.shape({
    columnId: PropTypes__default.default.string.isRequired,
    /* Visibility of column in table, defaults to false */
    isHidden: PropTypes__default.default.bool
  })).isRequired,
  rowEditMode: PropTypes__default.default.bool,
  singleRowEditButtons: PropTypes__default.default.element,
  /**
   * direction of document
   */
  langDir: PropTypes__default.default.oneOf(['ltr', 'rtl']),
  /** shows an additional column that can expand/shrink as the table is resized  */
  showExpanderColumn: PropTypes__default.default.bool,
  testId: PropTypes__default.default.string,
  /** Array with rowIds that are with loading active */
  loadingMoreIds: PropTypes__default.default.arrayOf(PropTypes__default.default.string),
  /** use white-space: pre; css when true */
  preserveCellWhiteSpace: PropTypes__default.default.bool,
  /**
   * the size passed to the table to set row height
   */
  size: PropTypes__default.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
  indeterminateSelectionIds: PropTypes__default.default.arrayOf(PropTypes__default.default.string),
  nestingLevel: PropTypes__default.default.number,
  someRowHasSingleRowEditMode: PropTypes__default.default.bool,
  row: TablePropTypes.TableRowPropTypes.isRequired,
  rows: TablePropTypes.TableRowsPropTypes,
  /** True if this row is the last child of a nested group */
  isLastChild: PropTypes__default.default.bool,
  /** If room is reserved for drag handles at the start of the row.. */
  hasDragAndDrop: PropTypes__default.default.bool,
  /** If all drag handles should be hidden. This happens when an undraggable row is in the selection. */
  hideDragHandles: PropTypes__default.default.bool,
  /**
   * The rows being dragged.
   */
  dragRowIds: PropTypes__default.default.arrayOf(PropTypes__default.default.string),
  /**
   * The rows that can accept a dropped row at this time. Since rows can be nested, this needs to be
   * passed all the way down so each row can decide if it accepts a drop or not.
   */
  canDropRowIds: PropTypes__default.default.instanceOf(Set),
  /** Callback for when a drag handle is clicked. */
  onStartDrag: PropTypes__default.default.func,
  /** Callback for when a row is entered during a drag. This is null when there is not drag. */
  onDragEnterRow: PropTypes__default.default.func,
  /** Callback for when a row is left during a drag. This is null when there is not drag. */
  onDragLeaveRow: PropTypes__default.default.func,
  /** Attribute name to identify deleted rows */
  deletedAttribute: PropTypes__default.default.string
};
var defaultProps = {
  actionFailedText: 'Action failed',
  clickToCollapseAria: 'Click to collapse.',
  clickToExpandAria: 'Click to expand.',
  columns: [],
  dismissText: 'Dismiss',
  dragHandleTooltip: 'Click and drag to new location',
  expandedIds: [],
  expandedRows: [],
  hasRowActions: false,
  hasRowExpansion: false,
  hasRowNesting: false,
  hasRowSelection: false,
  useRadioButtonSingleSelect: false,
  indeterminateSelectionIds: [],
  inProgressText: 'In progress',
  isDragging: false,
  langDir: 'ltr',
  learnMoreText: 'Learn more',
  loadingMoreIds: [],
  loadMoreText: 'Load more...',
  locale: null,
  nestingLevel: 0,
  overflowMenuAria: 'More actions',
  preserveCellWhiteSpace: false,
  rowActionsState: [],
  rowEditMode: false,
  rows: [],
  selectedIds: [],
  selectRowAria: 'Select row',
  shouldExpandOnRowClick: false,
  shouldLazyRender: false,
  showExpanderColumn: false,
  singleRowEditButtons: null,
  size: undefined,
  someRowHasSingleRowEditMode: false,
  testId: '',
  totalColumns: 0,
  isLastChild: false,
  hasDragAndDrop: false,
  hideDragHandles: false,
  onStartDrag: null,
  onDragEnterRow: null,
  onDragLeaveRow: null,
  dragRowIds: [],
  canDropRowIds: [],
  deletedAttribute: '_deleted'
};
function TableBodyRowRenderer(props) {
  var actionFailedText = props.actionFailedText,
    actions = props.actions,
    clickToCollapseAria = props.clickToCollapseAria,
    clickToExpandAria = props.clickToExpandAria,
    columns = props.columns,
    dismissText = props.dismissText,
    dragHandleTooltip = props.dragHandleTooltip,
    expandedIds = props.expandedIds,
    expandedRows = props.expandedRows,
    hasRowActions = props.hasRowActions,
    hasRowExpansion = props.hasRowExpansion,
    hasRowNesting = props.hasRowNesting,
    hasRowSelection = props.hasRowSelection,
    useRadioButtonSingleSelect = props.useRadioButtonSingleSelect,
    indeterminateSelectionIds = props.indeterminateSelectionIds,
    inProgressText = props.inProgressText,
    isDragging = props.isDragging,
    langDir = props.langDir,
    learnMoreText = props.learnMoreText,
    loadingMoreIds = props.loadingMoreIds,
    loadMoreText = props.loadMoreText,
    locale = props.locale,
    nestingLevel = props.nestingLevel,
    ordering = props.ordering,
    overflowMenuAria = props.overflowMenuAria,
    preserveCellWhiteSpace = props.preserveCellWhiteSpace,
    row = props.row,
    rowActionsState = props.rowActionsState,
    rowEditMode = props.rowEditMode,
    selectedIds = props.selectedIds,
    selectRowAria = props.selectRowAria,
    shouldExpandOnRowClick = props.shouldExpandOnRowClick,
    shouldLazyRender = props.shouldLazyRender,
    showExpanderColumn = props.showExpanderColumn,
    singleRowEditButtons = props.singleRowEditButtons,
    size = props.size,
    someRowHasSingleRowEditMode = props.someRowHasSingleRowEditMode,
    tableId = props.tableId,
    testId = props.testId,
    totalColumns = props.totalColumns,
    truncateCellText = props.truncateCellText,
    wrapCellText = props.wrapCellText,
    isLastChild = props.isLastChild,
    hasDragAndDrop = props.hasDragAndDrop,
    hideDragHandles = props.hideDragHandles,
    onStartDrag = props.onStartDrag,
    onDragLeaveRow = props.onDragLeaveRow,
    onDragEnterRow = props.onDragEnterRow,
    canDropRowIds = props.canDropRowIds,
    dragRowIds = props.dragRowIds,
    deletedAttribute = props.deletedAttribute;
  var isRowExpanded = expandedIds.includes(row.id);
  var shouldShowChildren = hasRowNesting && isRowExpanded && row.children && row.children.length > 0;
  var myRowActionState = rowActionsState.find(function (rowAction) {
    return rowAction.rowId === row.id;
  });
  var rowHasSingleRowEditMode = !!(myRowActionState && myRowActionState.isEditMode);
  var isSelectable = rowEditMode || someRowHasSingleRowEditMode ? false : row.isSelectable;
  var rowVisibilityRef = React.useRef(null);
  var _useVisibilityObserve = useVisibilityObserver(rowVisibilityRef, {
      unobserveAfterVisible: true
    }),
    _useVisibilityObserve2 = _slicedToArray__default.default(_useVisibilityObserve, 1),
    isVisible = _useVisibilityObserve2[0];
  if (shouldLazyRender && !isVisible) {
    return /*#__PURE__*/React__default.default.createElement(SkeletonRow, {
      id: row.id,
      tableId: tableId,
      columns: columns,
      rowVisibilityRef: rowVisibilityRef,
      testId: "".concat(tableId, "-lazy-row-").concat(row.id),
      hasRowActions: hasRowActions,
      hasRowExpansion: hasRowExpansion,
      hasRowNesting: hasRowNesting,
      hasRowSelection: hasRowSelection,
      showExpanderColumn: showExpanderColumn
    });
  }
  var canDrop = canDropRowIds.has(row.id);
  var rowElement = !row.isLoadMoreRow ? /*#__PURE__*/React__default.default.createElement(TableBodyRow, {
    hasDragAndDrop: hasDragAndDrop,
    hideDragHandles: hideDragHandles,
    onStartDrag: onStartDrag,
    onDragEnterRow: canDrop ? onDragEnterRow : null,
    onDragLeaveRow: canDrop ? onDragLeaveRow : null,
    isDragRow: dragRowIds.indexOf(row.id) !== -1,
    isDragging: isDragging,
    dragHandleTooltip: dragHandleTooltip,
    langDir: langDir,
    key: row.id,
    isExpanded: isRowExpanded,
    isSelectable: isSelectable,
    isSelected: selectedIds.includes(row.id),
    isIndeterminate: indeterminateSelectionIds.includes(row.id),
    rowEditMode: rowEditMode,
    singleRowEditMode: rowHasSingleRowEditMode,
    singleRowEditButtons: singleRowEditButtons,
    rowDetails: isRowExpanded && expandedRows.find(function (j) {
      return j.rowId === row.id;
    }) ? expandedRows.find(function (j) {
      return j.rowId === row.id;
    }).content : null,
    rowActionsError: myRowActionState ? myRowActionState.error : null,
    isRowActionRunning: myRowActionState ? myRowActionState.isRunning : null,
    ordering: ordering,
    selectRowAria: selectRowAria,
    overflowMenuAria: overflowMenuAria,
    clickToCollapseAria: clickToCollapseAria,
    clickToExpandAria: clickToExpandAria,
    inProgressText: inProgressText,
    actionFailedText: actionFailedText,
    learnMoreText: learnMoreText,
    dismissText: dismissText,
    columns: columns,
    tableId: tableId,
    id: row.id,
    locale: locale,
    totalColumns: totalColumns,
    options: {
      hasRowSelection: hasRowSelection,
      hasRowExpansion: hasRowExpansion,
      hasRowNesting: hasRowNesting,
      hasRowActions: hasRowActions,
      shouldExpandOnRowClick: shouldExpandOnRowClick,
      wrapCellText: wrapCellText,
      truncateCellText: truncateCellText,
      preserveCellWhiteSpace: preserveCellWhiteSpace,
      useRadioButtonSingleSelect: useRadioButtonSingleSelect
    },
    nestingLevel: nestingLevel,
    nestingChildCount: row.children ? row.children.length : 0,
    tableActions: _objectSpread({}, pick(actions, 'onApplyRowAction', 'onRowExpanded', 'onRowClicked', 'onClearRowError', 'onRowSelected')),
    rowActions: row.rowActions,
    values: row.values,
    isDraggable: row.isDraggable,
    showExpanderColumn: showExpanderColumn,
    size: size,
    isLastChild: isLastChild,
    deletedAttribute: deletedAttribute
  }) : /*#__PURE__*/React__default.default.createElement(TableBodyLoadMoreRow, {
    id: row.id,
    key: "".concat(row.id, "--load-more"),
    tableId: tableId,
    testId: testId,
    rowVisibilityRef: rowVisibilityRef,
    onRowLoadMore: actions === null || actions === void 0 ? void 0 : actions.onRowLoadMore,
    loadMoreText: loadMoreText,
    hasRowActions: hasRowActions,
    hasRowExpansion: hasRowExpansion,
    hasRowNesting: hasRowNesting,
    hasRowSelection: hasRowSelection,
    showExpanderColumn: showExpanderColumn,
    nestingLevel: nestingLevel,
    columns: columns,
    totalColumns: totalColumns,
    isLoadingMore: loadingMoreIds.includes(row.id)
  });
  return shouldShowChildren ? [rowElement].concat(row.children.map(function (childRow, i) {
    return /*#__PURE__*/React__default.default.createElement(TableBodyRowRenderer, _extends__default.default({
      key: "child-row-".concat(childRow.id)
    }, props, {
      row: childRow,
      nestingLevel: nestingLevel + 1,
      isLastChild: i === row.children.length - 1,
      hasDragAndDrop: hasDragAndDrop,
      hideDragHandles: hideDragHandles,
      onStartDrag: onStartDrag,
      onDragLeaveRow: onDragLeaveRow,
      onDragEnterRow: onDragEnterRow,
      canDropRowIds: canDropRowIds,
      dragRowIds: dragRowIds
    }));
  })).concat(row.hasLoadMore && row.children.length > 0 ? /*#__PURE__*/React__default.default.createElement(TableBodyRowRenderer, _extends__default.default({}, props, {
    key: "load-more-row-".concat(row.id),
    row: {
      id: row.id,
      isLoadMoreRow: true
    },
    nestingLevel: nestingLevel + 1,
    onStartDrag: onStartDrag,
    onDragLeaveRow: onDragLeaveRow,
    onDragEnterRow: onDragEnterRow,
    canDropRowIds: canDropRowIds
  })) : []) : rowElement;
}
TableBodyRowRenderer.defaultProps = defaultProps;
TableBodyRowRenderer.propTypes = propTypes;
TableBodyRowRenderer.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "TableBodyRowRenderer",
  "props": {
    "actionFailedText": {
      "defaultValue": {
        "value": "'Action failed'",
        "computed": false
      },
      "description": "I18N label for action failed",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "clickToCollapseAria": {
      "defaultValue": {
        "value": "'Click to collapse.'",
        "computed": false
      },
      "description": "internationalized label",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "clickToExpandAria": {
      "defaultValue": {
        "value": "'Click to expand.'",
        "computed": false
      },
      "description": "internationalized label",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "columns": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "TableColumnsPropTypes"
      },
      "required": false
    },
    "dismissText": {
      "defaultValue": {
        "value": "'Dismiss'",
        "computed": false
      },
      "description": "I18N label for dismiss",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "dragHandleTooltip": {
      "defaultValue": {
        "value": "'Click and drag to new location'",
        "computed": false
      },
      "description": "I18N label for drag handle tooltip",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "expandedIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "string"
        }
      },
      "required": false
    },
    "expandedRows": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "ExpandedRowsPropTypes"
      },
      "required": false
    },
    "hasRowActions": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hasRowExpansion": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hasRowNesting": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "union",
        "value": [{
          "name": "bool"
        }, {
          "name": "shape",
          "value": {
            "hasSingleNestedHierarchy": {
              "name": "bool",
              "description": "If the hierarchy only has 1 nested level of children",
              "required": false
            }
          }
        }]
      },
      "required": false
    },
    "hasRowSelection": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "enum",
        "value": [{
          "value": "'multi'",
          "computed": false
        }, {
          "value": "'single'",
          "computed": false
        }, {
          "value": "false",
          "computed": false
        }]
      },
      "required": false
    },
    "useRadioButtonSingleSelect": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "show radio button on single selection",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "indeterminateSelectionIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "string"
        }
      },
      "required": false
    },
    "inProgressText": {
      "defaultValue": {
        "value": "'In progress'",
        "computed": false
      },
      "description": "I18N label for in progress",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "isDragging": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "If a drag is currently in progress",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "langDir": {
      "defaultValue": {
        "value": "'ltr'",
        "computed": false
      },
      "description": "direction of document",
      "type": {
        "name": "enum",
        "value": [{
          "value": "'ltr'",
          "computed": false
        }, {
          "value": "'rtl'",
          "computed": false
        }]
      },
      "required": false
    },
    "learnMoreText": {
      "defaultValue": {
        "value": "'Learn more'",
        "computed": false
      },
      "description": "I18N label for learn more",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "loadingMoreIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "Array with rowIds that are with loading active",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "string"
        }
      },
      "required": false
    },
    "loadMoreText": {
      "defaultValue": {
        "value": "'Load more...'",
        "computed": false
      },
      "description": "I18N label for load more",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "locale": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "nestingLevel": {
      "defaultValue": {
        "value": "0",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "overflowMenuAria": {
      "defaultValue": {
        "value": "'More actions'",
        "computed": false
      },
      "description": "internationalized label",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "preserveCellWhiteSpace": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "use white-space: pre; css when true",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "rowActionsState": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "the current state of the row actions",
      "type": {
        "name": "custom",
        "raw": "RowActionsStatePropTypes"
      },
      "required": false
    },
    "rowEditMode": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "rows": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "TableRowsPropTypes"
      },
      "required": false
    },
    "selectedIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "string"
        }
      },
      "required": false
    },
    "selectRowAria": {
      "defaultValue": {
        "value": "'Select row'",
        "computed": false
      },
      "description": "internationalized label",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "shouldExpandOnRowClick": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "shouldLazyRender": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "showExpanderColumn": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "shows an additional column that can expand/shrink as the table is resized",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "singleRowEditButtons": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "element"
      },
      "required": false
    },
    "size": {
      "defaultValue": {
        "value": "undefined",
        "computed": true
      },
      "description": "the size passed to the table to set row height",
      "type": {
        "name": "enum",
        "value": [{
          "value": "'xs'",
          "computed": false
        }, {
          "value": "'sm'",
          "computed": false
        }, {
          "value": "'md'",
          "computed": false
        }, {
          "value": "'lg'",
          "computed": false
        }, {
          "value": "'xl'",
          "computed": false
        }]
      },
      "required": false
    },
    "someRowHasSingleRowEditMode": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "testId": {
      "defaultValue": {
        "value": "''",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "totalColumns": {
      "defaultValue": {
        "value": "0",
        "computed": false
      },
      "description": "since some columns might not be currently visible",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "isLastChild": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "True if this row is the last child of a nested group",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hasDragAndDrop": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "If room is reserved for drag handles at the start of the row..",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hideDragHandles": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "If all drag handles should be hidden. This happens when an undraggable row is in the selection.",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "onStartDrag": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Callback for when a drag handle is clicked.",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "onDragEnterRow": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Callback for when a row is entered during a drag. This is null when there is not drag.",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "onDragLeaveRow": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Callback for when a row is left during a drag. This is null when there is not drag.",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "dragRowIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "The rows being dragged.",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "string"
        }
      },
      "required": false
    },
    "canDropRowIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "The rows that can accept a dropped row at this time. Since rows can be nested, this needs to be\npassed all the way down so each row can decide if it accepts a drop or not.",
      "type": {
        "name": "instanceOf",
        "value": "Set"
      },
      "required": false
    },
    "deletedAttribute": {
      "defaultValue": {
        "value": "'_deleted'",
        "computed": false
      },
      "description": "Attribute name to identify deleted rows",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tableId": {
      "description": "The unique id of the table",
      "type": {
        "name": "string"
      },
      "required": true
    },
    "wrapCellText": {
      "description": "",
      "type": {
        "name": "custom",
        "raw": "WrapCellTextPropTypes.isRequired"
      },
      "required": false
    },
    "truncateCellText": {
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": true
    },
    "actions": {
      "description": "",
      "type": {
        "name": "shape",
        "value": {
          "onRowClicked": {
            "name": "func",
            "required": false
          },
          "onRowSelected": {
            "name": "func",
            "required": false
          },
          "onApplyRowActions": {
            "name": "func",
            "required": false
          },
          "onRowExpanded": {
            "name": "func",
            "required": false
          },
          "onRowLoadMore": {
            "name": "func",
            "required": false
          }
        }
      },
      "required": true
    },
    "ordering": {
      "description": "What column ordering is currently applied to the table",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "shape",
          "value": {
            "columnId": {
              "name": "string",
              "required": true
            },
            "isHidden": {
              "name": "bool",
              "required": false
            }
          }
        }
      },
      "required": true
    },
    "row": {
      "description": "",
      "type": {
        "name": "custom",
        "raw": "TableRowPropTypes.isRequired"
      },
      "required": false
    }
  }
};

module.exports = TableBodyRowRenderer;
