import _extends from "@babel/runtime/helpers/extends";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/Table/DataTable/docs/ExampleWithAnimatedRowDetails.jsx",
  _this = this;
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import React from 'react';
import DataTable from '..';
var style = {
  width: '966px'
};
var baseData = [{
  firstName: 'Meghan',
  lastName: 'Bishop'
}, {
  firstName: 'Sara',
  lastName: 'Porter'
}, {
  firstName: 'Deborah',
  lastName: 'Rhodes'
}, {
  firstName: 'Walter',
  lastName: 'Jenning'
}];
var generateData = function generateData() {
  var data = [];
  for (var i = 0; i < 2; i++) {
    data = data.concat(baseData);
  }
  return data;
};
var MyRowDetailsComponent = function MyRowDetailsComponent(props) {
  return /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '9px'
    },
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 5
    }
  }, /*#__PURE__*/React.createElement("h2", {
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 25,
      columnNumber: 7
    }
  }, "User Details"), /*#__PURE__*/React.createElement("p", {
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 26,
      columnNumber: 7
    }
  }, "First name: ", props.firstName), /*#__PURE__*/React.createElement("p", {
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 27,
      columnNumber: 7
    }
  }, "Last name: ", props.lastName));
};
var ExampleWithAnimatedRowDetails = /*#__PURE__*/function (_React$Component) {
  function ExampleWithAnimatedRowDetails() {
    _classCallCheck(this, ExampleWithAnimatedRowDetails);
    return _callSuper(this, ExampleWithAnimatedRowDetails, arguments);
  }
  _inherits(ExampleWithAnimatedRowDetails, _React$Component);
  return _createClass(ExampleWithAnimatedRowDetails, [{
    key: "render",
    value: function render() {
      var _this2 = this;
      return /*#__PURE__*/React.createElement("div", {
        style: style,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 35,
          columnNumber: 7
        }
      }, /*#__PURE__*/React.createElement(DataTable, {
        dataHook: "story-data-table",
        data: generateData(),
        rowDetails: function rowDetails(row) {
          return /*#__PURE__*/React.createElement(MyRowDetailsComponent, _extends({}, row, {
            __self: _this2,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 39,
              columnNumber: 30
            }
          }));
        },
        rowDetailsAnimation: true,
        allowMultiDetailsExpansion: true,
        columns: [{
          title: 'Row Number',
          render: function render(row, rowNum) {
            return '#' + (rowNum + 1);
          },
          width: '20%',
          important: true
        }, {
          title: 'First Name',
          render: function render(row) {
            return /*#__PURE__*/React.createElement("span", {
              __self: _this2,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 51,
                columnNumber: 30
              }
            }, row.firstName);
          },
          width: '40%'
        }, {
          title: 'Last Name',
          render: function render(row) {
            return /*#__PURE__*/React.createElement("span", {
              __self: _this2,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 56,
                columnNumber: 30
              }
            }, row.lastName);
          },
          width: '40%'
        }],
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 36,
          columnNumber: 9
        }
      }));
    }
  }]);
}(React.Component);
export default ExampleWithAnimatedRowDetails;