import 'core-js/modules/es.array.concat.js';
import 'core-js/modules/es.array.map.js';
import React__default from 'react';
import { TableCell, SkeletonText } from '@carbon/react';
import PropTypes from 'prop-types';
import { TableColumnsPropTypes } from '../TablePropTypes.js';
import { HtmlElementRefProp } from '../../../constants/SharedPropTypes.js';

var propTypes = {
  /** The unique row id */
  id: PropTypes.string.isRequired,
  /** The unique id for the table */
  tableId: PropTypes.string.isRequired,
  /** The unique id for the table test */
  testId: PropTypes.string,
  columns: TableColumnsPropTypes,
  /** since some columns might not be currently visible */
  hasRowSelection: PropTypes.oneOf(['multi', 'single', false]),
  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,
  /** shows an additional column that can expand/shrink as the table is resized  */
  showExpanderColumn: PropTypes.bool,
  rowVisibilityRef: HtmlElementRefProp
};
var defaultProps = {
  testId: 'skeleton-row',
  columns: [],
  hasRowActions: false,
  hasRowExpansion: false,
  hasRowNesting: false,
  hasRowSelection: false,
  showExpanderColumn: false,
  rowVisibilityRef: undefined
};
var SkeletonRow = function SkeletonRow(_ref) {
  var id = _ref.id,
    tableId = _ref.tableId,
    testId = _ref.testId,
    rowVisibilityRef = _ref.rowVisibilityRef,
    hasRowActions = _ref.hasRowActions,
    hasRowExpansion = _ref.hasRowExpansion,
    hasRowNesting = _ref.hasRowNesting,
    hasRowSelection = _ref.hasRowSelection,
    showExpanderColumn = _ref.showExpanderColumn,
    columns = _ref.columns;
  return /*#__PURE__*/React__default.createElement("tr", {
    key: "lazy-row-".concat(id),
    ref: rowVisibilityRef,
    "data-testid": "".concat(tableId, "-").concat(testId)
  }, hasRowSelection === 'multi' ? /*#__PURE__*/React__default.createElement(TableCell, null) : null, hasRowExpansion || hasRowNesting ? /*#__PURE__*/React__default.createElement(TableCell, null) : null, columns.map(function (v, colIndex) {
    return /*#__PURE__*/React__default.createElement(TableCell, {
      key: "empty-cell-".concat(colIndex)
    }, /*#__PURE__*/React__default.createElement(SkeletonText, null));
  }), showExpanderColumn ? /*#__PURE__*/React__default.createElement(TableCell, null) : null, hasRowActions ? /*#__PURE__*/React__default.createElement(TableCell, null) : null);
};
SkeletonRow.defaultProps = defaultProps;
SkeletonRow.propTypes = propTypes;
SkeletonRow.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "SkeletonRow",
  "props": {
    "testId": {
      "defaultValue": {
        "value": "'skeleton-row'",
        "computed": false
      },
      "description": "The unique id for the table test",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "columns": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "TableColumnsPropTypes"
      },
      "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": "since some columns might not be currently visible",
      "type": {
        "name": "enum",
        "value": [{
          "value": "'multi'",
          "computed": false
        }, {
          "value": "'single'",
          "computed": false
        }, {
          "value": "false",
          "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
    },
    "rowVisibilityRef": {
      "defaultValue": {
        "value": "undefined",
        "computed": true
      },
      "description": "",
      "type": {
        "name": "custom",
        "raw": "HtmlElementRefProp"
      },
      "required": false
    },
    "id": {
      "description": "The unique row id",
      "type": {
        "name": "string"
      },
      "required": true
    },
    "tableId": {
      "description": "The unique id for the table",
      "type": {
        "name": "string"
      },
      "required": true
    }
  }
};
var SkeletonRow$1 = SkeletonRow;

export { SkeletonRow$1 as default };
