"use strict";

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

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

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

var _table = _interopRequireDefault(require("../../table"));

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

var Tooltip = _["default"].Tooltip;
var dataSource = [{
  name: 'Li Bai',
  intro: 'Li Bai (Chinese: 李白; pinyin: Lǐ Bái; 701–762), also known as Li Bo, courtesy name Taibai (Chinese: 太白), art name Qinglian Jushi (Chinese: 青蓮居士), was a Chinese poet acclaimed from his own day to the present as a genius and a romantic figure who took traditional poetic forms to new heights.',
  id: 100306660940
}, {
  name: 'William Shakespeare',
  intro: 'William Shakespeare (bapt. 26 April 1564 – 23 April 1616) was an English playwright, poet, and actor, widely regarded as the greatest writer in the English language and the world\'s greatest dramatist. He is often called England\'s national poet and the "Bard of Avon" (or simply "the Bard").',
  id: 100306660941
}];

var render = function render(value) {
  var intro = /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      whiteSpace: 'nowrap'
    }
  }, value);

  return /*#__PURE__*/_react["default"].createElement(Tooltip, {
    trigger: intro,
    triggerType: 'click',
    align: "br"
  }, value);
};

var App = function App() {
  return /*#__PURE__*/_react["default"].createElement(_table["default"], {
    dataSource: dataSource,
    tableLayout: "fixed"
  }, /*#__PURE__*/_react["default"].createElement(_table["default"].Column, {
    title: "ID",
    dataIndex: "id",
    width: 100
  }), /*#__PURE__*/_react["default"].createElement(_table["default"].Column, {
    title: "Name",
    dataIndex: "name",
    width: 200
  }), /*#__PURE__*/_react["default"].createElement(_table["default"].Column, {
    title: "Intro",
    dataIndex: "intro",
    cell: render,
    width: 400
  }));
};

_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(App, null), document.getElementById('balloon-demo-2'));