"use strict";

var _menuButton = _interopRequireDefault(require("../../menu-button"));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

var _ = _interopRequireDefault(require(".."));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var Item = _menuButton["default"].Item;

var dataSource = function dataSource() {
  var result = [];

  for (var i = 0; i < 5; i++) {
    result.push({
      title: {
        name: "Quotation for 1PCS Nano ".concat(3 + i, ".0 controller compatible")
      },
      id: 100306660940 + i,
      time: 2000 + i
    });
  }

  return result;
};

var render = function render(value, index, record) {
  return /*#__PURE__*/_react["default"].createElement("a", {
    href: "javascript:;"
  }, "Remove(", record.id, ")"); // eslint-disable-line
};

var onChange = function onChange() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  console.log(args);
};

var selectItem = function selectItem(id) {
  console.log(id);
};

_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(_["default"], {
  dataSource: dataSource(),
  hasBorder: false,
  rowSelection: {
    onChange: onChange,
    getProps: function getProps(record, index) {
      console.log(record, index);
      return index === 2 ? {
        disabled: true,
        children: index
      } : {
        children: index
      };
    },
    columnProps: function columnProps() {
      return {
        lock: 'left',
        width: 90,
        align: 'center'
      };
    },
    titleProps: function titleProps() {
      return {
        // remove the select all button
        // style: {display: 'none'},
        disabled: true,
        children: /*#__PURE__*/_react["default"].createElement(_menuButton["default"], {
          text: true,
          onItemClick: selectItem,
          menuProps: {
            isSelectIconRight: true
          }
        }, /*#__PURE__*/_react["default"].createElement(Item, {
          key: "odd"
        }, "odd"), /*#__PURE__*/_react["default"].createElement(Item, {
          key: "even"
        }, "even"))
      };
    }
  }
}, /*#__PURE__*/_react["default"].createElement(_["default"].Column, {
  title: "Id",
  dataIndex: "id",
  width: 200
}), /*#__PURE__*/_react["default"].createElement(_["default"].Column, {
  title: "Title",
  dataIndex: "title.name",
  width: 200
}), /*#__PURE__*/_react["default"].createElement(_["default"].Column, {
  title: "Time",
  dataIndex: "time",
  width: 200
}), /*#__PURE__*/_react["default"].createElement(_["default"].Column, {
  cell: render,
  width: 200
})), document.getElementById('table-demo-3'));