"use strict";

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 Option = _["default"].Option;

var onChange = function onChange(value) {
  console.log(value);
};

function generateItem(index) {
  return {
    label: "option".concat(index),
    value: "option".concat(index)
  };
}

function generateOption(index) {
  return /*#__PURE__*/_react["default"].createElement(Option, {
    key: "option".concat(index),
    value: "option".concat(index)
  }, "option".concat(index));
}

function generateData(len, isOption) {
  var data = [];

  for (var i = 0; i < len; i++) {
    isOption ? data.push(generateOption(i)) : data.push(generateItem(i));
  }

  return data;
}

_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_["default"], {
  dataSource: generateData(100, true),
  useVirtual: true,
  onChange: onChange,
  defaultValue: "option0"
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_["default"], {
  useVirtual: true,
  onChange: onChange,
  defaultValue: "option50"
}, generateData(100, true)), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_["default"], {
  style: {
    width: 300
  },
  hasSelectAll: true,
  tagInline: true,
  mode: "multiple",
  dataSource: generateData(100, true),
  useVirtual: true,
  onChange: onChange,
  defaultValue: ['option0']
})), document.getElementById('select-demo-17'));