import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import 'core-js/modules/es.symbol.js';
import 'core-js/modules/es.array.concat.js';
import 'core-js/modules/es.array.filter.js';
import 'core-js/modules/es.array.find.js';
import 'core-js/modules/es.array.includes.js';
import 'core-js/modules/es.array.iterator.js';
import 'core-js/modules/es.array.map.js';
import 'core-js/modules/es.array.sort.js';
import 'core-js/modules/es.array.splice.js';
import 'core-js/modules/es.object.get-own-property-descriptor.js';
import 'core-js/modules/es.object.get-own-property-descriptors.js';
import 'core-js/modules/es.object.keys.js';
import 'core-js/modules/es.object.to-string.js';
import 'core-js/modules/es.set.js';
import 'core-js/modules/es.string.includes.js';
import 'core-js/modules/es.string.iterator.js';
import 'core-js/modules/web.dom-collections.for-each.js';
import 'core-js/modules/web.dom-collections.iterator.js';
import React__default, { useMemo } from 'react';
import PropTypes from 'prop-types';
import { TableBody as TableBody$2 } from '@carbon/react';
import classnames from 'classnames';
import { TableRowsPropTypes, ExpandedRowsPropTypes, TableColumnsPropTypes, RowActionsStatePropTypes, PinColumnPropTypes } from '../TablePropTypes.js';
import deprecate from '../../../internal/deprecate.js';
import { WrapCellTextPropTypes } from '../../../constants/SharedPropTypes.js';
import { pinColumnClassNames, PIN_COLUMN, tableTraverser, findRow } from '../tableUtilities.js';
import TableBodyRowRenderer from './TableBodyRowRenderer.js';
import { useTableDnd } from './useTableDnd.js';

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(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.string.isRequired,
  rows: TableRowsPropTypes,
  expandedRows: ExpandedRowsPropTypes,
  columns: TableColumnsPropTypes,
  expandedIds: PropTypes.arrayOf(PropTypes.string),
  selectedIds: PropTypes.arrayOf(PropTypes.string),
  /** internationalized label */
  selectRowAria: PropTypes.string,
  /** internationalized label */
  overflowMenuAria: PropTypes.string,
  /** internationalized label */
  clickToExpandAria: PropTypes.string,
  /** internationalized label */
  clickToCollapseAria: PropTypes.string,
  /** I18N label for in progress */
  inProgressText: PropTypes.string,
  /** I18N label for action failed */
  actionFailedText: PropTypes.string,
  /** I18N label for learn more */
  learnMoreText: PropTypes.string,
  /** I18N label for dismiss */
  dismissText: PropTypes.string,
  /** I18N label for load more */
  loadMoreText: PropTypes.string,
  /** I18N label for drag handle tooltip */
  dragHandleTooltip: PropTypes.string,
  /** since some columns might not be currently visible */
  totalColumns: PropTypes.number,
  hasRowSelection: PropTypes.oneOf(['multi', 'single', false]),
  useRadioButtonSingleSelect: PropTypes.bool,
  hasRowExpansion: PropTypes.bool,
  hasRowNesting: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
    /** If the hierarchy only has 1 nested level of children */
    hasSingleNestedHierarchy: PropTypes.bool
  })]),
  hasRowActions: PropTypes.bool,
  wrapCellText: WrapCellTextPropTypes.isRequired,
  truncateCellText: PropTypes.bool.isRequired,
  /** the current state of the row actions */
  rowActionsState: RowActionsStatePropTypes,
  shouldExpandOnRowClick: PropTypes.bool,
  shouldLazyRender: PropTypes.bool,
  locale: PropTypes.string,
  actions: PropTypes.shape({
    onRowSelected: PropTypes.func,
    onRowClicked: PropTypes.func,
    onApplyRowActions: PropTypes.func,
    onRowExpanded: PropTypes.func,
    onRowLoadMore: PropTypes.func,
    onDrag: PropTypes.func,
    onDrop: PropTypes.func
  }).isRequired,
  /** What column ordering is currently applied to the table */
  ordering: PropTypes.arrayOf(PropTypes.shape({
    columnId: PropTypes.string.isRequired,
    /* Visibility of column in table, defaults to false */
    isHidden: PropTypes.bool
  })).isRequired,
  rowEditMode: PropTypes.bool,
  singleRowEditButtons: PropTypes.element,
  /**
   * direction of document
   */
  langDir: PropTypes.oneOf(['ltr', 'rtl']),
  /** shows an additional column that can expand/shrink as the table is resized  */
  showExpanderColumn: PropTypes.bool,
  // TODO: remove deprecated 'testID' in v3
  // eslint-disable-next-line react/require-default-props
  testID: deprecate(PropTypes.string, "The 'testID' prop has been deprecated. Please use 'testId' instead."),
  testId: PropTypes.string,
  /** Array with rowIds that are with loading active */
  loadingMoreIds: PropTypes.arrayOf(PropTypes.string),
  /** use white-space: pre; css when true */
  preserveCellWhiteSpace: PropTypes.bool,
  /**
   * the size passed to the table to set row height
   */
  size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
  /** If room is reserved for drag handles at the start of rows. */
  hasDragAndDrop: PropTypes.bool,
  /** If true will pass it to DnD component so that breadcrumb items are considered as drop targets. */
  hasBreadcrumbDrop: PropTypes.bool,
  /** If all drag handles should be hidden. This happens when an undraggable row is in the selection. */
  hideDragHandles: PropTypes.bool,
  /** Optional base z-index for the drag image. See details on Table component. */
  zIndex: PropTypes.number,
  /** column to pin in the table */
  pinColumn: PinColumnPropTypes,
  /** Attribute name to identify deleted rows */
  deletedAttribute: PropTypes.string
};
var defaultProps = {
  expandedIds: [],
  selectedIds: [],
  loadingMoreIds: [],
  selectRowAria: 'Select row',
  overflowMenuAria: 'More actions',
  clickToExpandAria: 'Click to expand.',
  clickToCollapseAria: 'Click to collapse.',
  locale: null,
  rows: [],
  expandedRows: [],
  rowActionsState: [],
  columns: [],
  totalColumns: 0,
  hasRowSelection: false,
  useRadioButtonSingleSelect: false,
  hasRowExpansion: false,
  hasRowNesting: false,
  hasRowActions: false,
  shouldExpandOnRowClick: false,
  shouldLazyRender: false,
  rowEditMode: false,
  singleRowEditButtons: null,
  langDir: 'ltr',
  showExpanderColumn: false,
  testId: '',
  preserveCellWhiteSpace: false,
  loadMoreText: 'Load more...',
  learnMoreText: 'Learn more',
  inProgressText: 'In progress',
  dismissText: 'Dismiss',
  actionFailedText: 'Action failed',
  dragHandleTooltip: 'Click and drag to new location',
  size: undefined,
  hasDragAndDrop: false,
  hasBreadcrumbDrop: false,
  hideDragHandles: false,
  zIndex: 0,
  pinColumn: PIN_COLUMN.NONE,
  deletedAttribute: '_deleted'
};
var TableBody = function TableBody(_ref) {
  var tableId = _ref.tableId,
    rows = _ref.rows,
    columns = _ref.columns,
    expandedIds = _ref.expandedIds,
    expandedRows = _ref.expandedRows,
    selectedIds = _ref.selectedIds,
    loadingMoreIds = _ref.loadingMoreIds,
    selectRowAria = _ref.selectRowAria,
    overflowMenuAria = _ref.overflowMenuAria,
    clickToExpandAria = _ref.clickToExpandAria,
    clickToCollapseAria = _ref.clickToCollapseAria,
    inProgressText = _ref.inProgressText,
    learnMoreText = _ref.learnMoreText,
    dismissText = _ref.dismissText,
    actionFailedText = _ref.actionFailedText,
    loadMoreText = _ref.loadMoreText,
    dragHandleTooltip = _ref.dragHandleTooltip,
    totalColumns = _ref.totalColumns,
    actions = _ref.actions,
    rowActionsState = _ref.rowActionsState,
    hasRowActions = _ref.hasRowActions,
    hasRowSelection = _ref.hasRowSelection,
    useRadioButtonSingleSelect = _ref.useRadioButtonSingleSelect,
    hasRowExpansion = _ref.hasRowExpansion,
    hasRowNesting = _ref.hasRowNesting,
    shouldExpandOnRowClick = _ref.shouldExpandOnRowClick,
    shouldLazyRender = _ref.shouldLazyRender,
    ordering = _ref.ordering,
    wrapCellText = _ref.wrapCellText,
    truncateCellText = _ref.truncateCellText,
    locale = _ref.locale,
    rowEditMode = _ref.rowEditMode,
    singleRowEditButtons = _ref.singleRowEditButtons,
    langDir = _ref.langDir,
    testID = _ref.testID,
    testId = _ref.testId,
    showExpanderColumn = _ref.showExpanderColumn,
    preserveCellWhiteSpace = _ref.preserveCellWhiteSpace,
    size = _ref.size,
    hasDragAndDrop = _ref.hasDragAndDrop,
    hasBreadcrumbDrop = _ref.hasBreadcrumbDrop,
    hideDragHandles = _ref.hideDragHandles,
    zIndex = _ref.zIndex,
    pinColumn = _ref.pinColumn,
    deletedAttribute = _ref.deletedAttribute;
  // Need to merge the ordering and the columns since the columns have the renderer function
  var orderingMap = useMemo(function () {
    return ordering.map(function (col) {
      return _objectSpread(_objectSpread({}, col), columns.find(function (column) {
        return column.id === col.columnId;
      }));
    });
  }, [columns, ordering]);
  var findAllAncestorRows = function findAllAncestorRows(childId, myRows) {
    var result = [];
    var applyFunc = function applyFunc(row, ancestors) {
      var _result, _row$children;
      var lastChildId = ((_result = result[result.length - 1]) === null || _result === void 0 ? void 0 : _result.id) || childId;
      var currentRowIsParent = (_row$children = row.children) === null || _row$children === void 0 ? void 0 : _row$children.filter(function (child) {
        return child.id === lastChildId;
      }).length;
      if (currentRowIsParent) {
        ancestors.push(row);
      }
    };
    tableTraverser(myRows, applyFunc, result);
    return result;
  };
  var findAllChildRowIds = function findAllChildRowIds(_ref2) {
    var _ref2$children = _ref2.children,
      children = _ref2$children === void 0 ? [] : _ref2$children;
    var result = [];
    tableTraverser(children, function (row, aggr) {
      return aggr.push(row.id);
    }, result);
    return result;
  };
  var updateChildIdSelection = function updateChildIdSelection(triggeringRowId, myRows, selection) {
    var row = findRow(triggeringRowId, myRows);
    var childRowIds = findAllChildRowIds(row);
    var triggeringRowSelected = selection.includes(triggeringRowId);
    return triggeringRowSelected ? _toConsumableArray(new Set(selection.concat(childRowIds))) : selection.filter(function (id) {
      return !childRowIds.includes(id);
    });
  };
  var updateAncestorSelection = function updateAncestorSelection(allAncestorRows, selection) {
    var newSelection = _toConsumableArray(selection);
    allAncestorRows.forEach(function (ancestorRow) {
      if (ancestorRow.children.every(function (child) {
        return newSelection.includes(child.id);
      })) {
        newSelection.push(ancestorRow.id);
      } else if (newSelection.includes(ancestorRow.id)) {
        newSelection.splice(newSelection.indexOf(ancestorRow.id), 1);
      }
    });
    return newSelection;
  };
  var onRowSelected = function onRowSelected(rowId, selected) {
    if (hasRowSelection === 'single') {
      actions.onRowSelected(rowId, selected, selected ? [rowId] : []);
    } else {
      var allAncestorRows = findAllAncestorRows(rowId, rows) || [];
      var withNewSelection = selected ? [].concat(_toConsumableArray(selectedIds), [rowId]) : selectedIds.filter(function (id) {
        return id !== rowId;
      });
      var withUpdatedAncestors = updateAncestorSelection(allAncestorRows, withNewSelection);
      var withUpdatedChildren = updateChildIdSelection(rowId, rows, withUpdatedAncestors);
      actions.onRowSelected(rowId, selected, withUpdatedChildren.sort());
    }
  };
  var getIndeterminateRowSelectionIds = function getIndeterminateRowSelectionIds(myRows, mySelectedIds) {
    var result = [];
    if (hasRowNesting && mySelectedIds.length) {
      var applyFunc = function applyFunc(row, indeterminateList) {
        var allChildren = findAllChildRowIds(row);
        var allAreSelected = allChildren.every(function (childId) {
          return mySelectedIds.includes(childId);
        });
        var someAreSelected = !allAreSelected && allChildren.some(function (childId) {
          return mySelectedIds.includes(childId);
        });
        if (someAreSelected) {
          indeterminateList.push(row.id);
        }
      };
      tableTraverser(myRows, applyFunc, result);
    }
    return result;
  };
  var _useTableDnd = useTableDnd(rows, selectedIds, zIndex, actions.onDrag, actions.onDrop, hasBreadcrumbDrop),
    isDragging = _useTableDnd.isDragging,
    dragPreview = _useTableDnd.dragPreview,
    dragRowIds = _useTableDnd.dragRowIds,
    canDropRowIds = _useTableDnd.canDropRowIds,
    handleStartPossibleDrag = _useTableDnd.handleStartPossibleDrag,
    handleEnterRow = _useTableDnd.handleEnterRow,
    handleLeaveRow = _useTableDnd.handleLeaveRow;
  var tableBodyClassNames = classnames(pinColumnClassNames({
    pinColumn: pinColumn,
    hasRowSelection: hasRowSelection,
    hasRowExpansion: hasRowExpansion,
    hasRowNesting: hasRowNesting
  }));
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TableBody$2, {
    "data-testid": testID || testId,
    className: tableBodyClassNames || undefined
  }, rows.map(function (row) {
    return /*#__PURE__*/React__default.createElement(TableBodyRowRenderer, {
      key: row.id,
      actionFailedText: actionFailedText,
      actions: _objectSpread(_objectSpread({}, actions), {}, {
        onRowSelected: onRowSelected
      }),
      clickToCollapseAria: clickToCollapseAria,
      clickToExpandAria: clickToExpandAria,
      columns: columns,
      dismissText: dismissText,
      dragHandleTooltip: dragHandleTooltip,
      expandedIds: expandedIds,
      expandedRows: expandedRows,
      hasRowActions: hasRowActions,
      hasRowExpansion: hasRowExpansion,
      hasRowNesting: hasRowNesting,
      hasRowSelection: hasRowSelection,
      useRadioButtonSingleSelect: useRadioButtonSingleSelect,
      indeterminateSelectionIds: getIndeterminateRowSelectionIds(rows, selectedIds),
      inProgressText: inProgressText,
      isDragging: isDragging,
      langDir: langDir,
      learnMoreText: learnMoreText,
      loadingMoreIds: loadingMoreIds,
      loadMoreText: loadMoreText,
      locale: locale,
      ordering: orderingMap,
      overflowMenuAria: overflowMenuAria,
      preserveCellWhiteSpace: preserveCellWhiteSpace,
      row: row,
      rowActionsState: rowActionsState,
      rowEditMode: rowEditMode,
      selectedIds: selectedIds,
      selectRowAria: selectRowAria,
      shouldExpandOnRowClick: shouldExpandOnRowClick,
      shouldLazyRender: shouldLazyRender,
      showExpanderColumn: showExpanderColumn,
      singleRowEditButtons: singleRowEditButtons,
      size: size,
      someRowHasSingleRowEditMode: rowActionsState.some(function (rowAction) {
        return rowAction.isEditMode;
      }),
      tableId: tableId,
      testId: testID || testId,
      totalColumns: totalColumns,
      truncateCellText: truncateCellText,
      wrapCellText: wrapCellText,
      hasDragAndDrop: hasDragAndDrop,
      hideDragHandles: hideDragHandles,
      onStartDrag: handleStartPossibleDrag,
      onDragEnterRow: isDragging ? handleEnterRow : null,
      onDragLeaveRow: isDragging ? handleLeaveRow : null,
      dragRowIds: dragRowIds,
      canDropRowIds: canDropRowIds,
      deletedAttribute: deletedAttribute
    });
  })), dragPreview);
};
TableBody.propTypes = propTypes;
TableBody.defaultProps = defaultProps;
TableBody.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "TableBody",
  "props": {
    "expandedIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "string"
        }
      },
      "required": false
    },
    "selectedIds": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "arrayOf",
        "value": {
          "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
    },
    "selectRowAria": {
      "defaultValue": {
        "value": "'Select row'",
        "computed": false
      },
      "description": "internationalized label",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "overflowMenuAria": {
      "defaultValue": {
        "value": "'More actions'",
        "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
    },
    "clickToCollapseAria": {
      "defaultValue": {
        "value": "'Click to collapse.'",
        "computed": false
      },
      "description": "internationalized label",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "locale": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "rows": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "TableRowsPropTypes"
      },
      "required": false
    },
    "expandedRows": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "ExpandedRowsPropTypes"
      },
      "required": false
    },
    "rowActionsState": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "the current state of the row actions",
      "type": {
        "name": "custom",
        "raw": "RowActionsStatePropTypes"
      },
      "required": false
    },
    "columns": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "TableColumnsPropTypes"
      },
      "required": false
    },
    "totalColumns": {
      "defaultValue": {
        "value": "0",
        "computed": false
      },
      "description": "since some columns might not be currently visible",
      "type": {
        "name": "number"
      },
      "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": "",
      "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
    },
    "hasRowActions": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "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
    },
    "rowEditMode": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "singleRowEditButtons": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "element"
      },
      "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
    },
    "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
    },
    "testId": {
      "defaultValue": {
        "value": "''",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "preserveCellWhiteSpace": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "use white-space: pre; css when true",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "loadMoreText": {
      "defaultValue": {
        "value": "'Load more...'",
        "computed": false
      },
      "description": "I18N label for load more",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "learnMoreText": {
      "defaultValue": {
        "value": "'Learn more'",
        "computed": false
      },
      "description": "I18N label for learn more",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "inProgressText": {
      "defaultValue": {
        "value": "'In progress'",
        "computed": false
      },
      "description": "I18N label for in progress",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "dismissText": {
      "defaultValue": {
        "value": "'Dismiss'",
        "computed": false
      },
      "description": "I18N label for dismiss",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "actionFailedText": {
      "defaultValue": {
        "value": "'Action failed'",
        "computed": false
      },
      "description": "I18N label for action failed",
      "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
    },
    "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
    },
    "hasDragAndDrop": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "If room is reserved for drag handles at the start of rows.",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hasBreadcrumbDrop": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "If true will pass it to DnD component so that breadcrumb items are considered as drop targets.",
      "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
    },
    "zIndex": {
      "defaultValue": {
        "value": "0",
        "computed": false
      },
      "description": "Optional base z-index for the drag image. See details on Table component.",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "pinColumn": {
      "defaultValue": {
        "value": "PIN_COLUMN.NONE",
        "computed": true
      },
      "description": "column to pin in the table",
      "type": {
        "name": "custom",
        "raw": "PinColumnPropTypes"
      },
      "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": {
          "onRowSelected": {
            "name": "func",
            "required": false
          },
          "onRowClicked": {
            "name": "func",
            "required": false
          },
          "onApplyRowActions": {
            "name": "func",
            "required": false
          },
          "onRowExpanded": {
            "name": "func",
            "required": false
          },
          "onRowLoadMore": {
            "name": "func",
            "required": false
          },
          "onDrag": {
            "name": "func",
            "required": false
          },
          "onDrop": {
            "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
    },
    "testID": {
      "description": "",
      "type": {
        "name": "custom",
        "raw": "deprecate(\n  PropTypes.string,\n  `The 'testID' prop has been deprecated. Please use 'testId' instead.`\n)"
      },
      "required": false
    }
  }
};
var TableBody$1 = TableBody;

export { TableBody$1 as default };
