"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof3 = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.deprecatedLogForPopover = void 0;

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));

var _propTypes = _interopRequireDefault(require("prop-types"));

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

var _Popover = _interopRequireDefault(require("../../components/Popover"));

var _ConfigContext = _interopRequireDefault(require("../../components/ConfigProvider/ConfigContext"));

var _useLocale = _interopRequireDefault(require("../../components/LocaleProvider/useLocale"));

var _group3 = require("../../hooks/group");

var _usePopoverConfig = require("../../hooks/usePopoverConfig");

var _useUncontrolled5 = _interopRequireDefault(require("../../hooks/useUncontrolled"));

var _useInitial = _interopRequireDefault(require("../../hooks/useInitial"));

var _noop = _interopRequireDefault(require("../../utils/noop"));

var _deprecatedLog = _interopRequireDefault(require("../../utils/deprecatedLog"));

var _warning = require("../../utils/warning");

var _isObject = _interopRequireDefault(require("../../utils/isObject"));

var _isEmpty = _interopRequireDefault(require("../../utils/isEmpty"));

var _Option = require("./Option");

var _Group = _interopRequireDefault(require("./Group"));

var _Extra = _interopRequireDefault(require("./Extra"));

var _style = require("./style");

var _SelectContext = _interopRequireDefault(require("./SelectContext"));

var _zh_CN = _interopRequireDefault(require("./locale/zh_CN"));

var _excluded = ["size", "disabled", "multiple", "placeholder", "renderContent", "renderSelector", "renderPopup", "value", "visible", "locale", "dataSource"],
    _excluded2 = ["content"],
    _excluded3 = ["size", "value", "defaultValue", "onChange", "onVisibleChange", "disabled", "search", "multiple", "renderContent", "renderSelector", "placeholder", "locale", "options", "children", "emptyContent", "showSelectAll", "extra", "customStyle", "popover", "popoverProps", "renderPopup", "virtualList"];

var _this = void 0;

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

var deprecatedLogForPopover = (0, _deprecatedLog.default)('Select popover', 'popoverProps');
exports.deprecatedLogForPopover = deprecatedLogForPopover;
var warnLogForVirtualList = (0, _warning.onceWarning)('Select virtualList only valid when use options');
var warnLogForCustomHeight = (0, _warning.onceWarning)('CustomStyle.optionListMaxHeight is invalid when use virtualList, please use virtualList.height');
var warnLogForSearchProps = (0, _warning.onceWarning)("Don't use item.props in custom search, just use item as props.");
var groupOptions = {
  itemTag: 'isMenuItem',
  subGroupTag: 'isMenuSubMenu',
  itemKeyName: 'value',
  subGroupKeyName: 'groupKey',
  displayName: 'label',
  subGroupName: 'children',
  ItemComponent: _Option.PureOption,
  SubGroupComponent: _Group.default
};

var Selector = function Selector(_ref) {
  var _this2 = this;

  (0, _newArrowCheck2.default)(this, _this);
  var size = _ref.size,
      disabled = _ref.disabled,
      multiple = _ref.multiple,
      placeholder = _ref.placeholder,
      renderContent = _ref.renderContent,
      renderSelector = _ref.renderSelector,
      renderPopup = _ref.renderPopup,
      value = _ref.value,
      visible = _ref.visible,
      locale = _ref.locale,
      dataSource = _ref.dataSource,
      rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  placeholder = (0, _react.useMemo)(function () {
    (0, _newArrowCheck2.default)(this, _this2);
    return placeholder || locale.placeholder;
  }.bind(this), [locale.placeholder, placeholder]);
  var defaultRenderContent = (0, _react.useCallback)(function (value, valueChild) {
    (0, _newArrowCheck2.default)(this, _this2);

    if (!multiple) {
      if (value === undefined) {
        return placeholder;
      } else {
        return valueChild;
      }
    } else {
      if (value && value.length) {
        return "".concat(locale.selected).concat(value.length).concat(locale.items);
      } else {
        return placeholder;
      }
    }
  }.bind(this), [locale.items, locale.selected, multiple, placeholder]);
  var getContent = (0, _react.useCallback)(function () {
    var _this3 = this;

    (0, _newArrowCheck2.default)(this, _this2);

    var _dataSource = (0, _slicedToArray2.default)(dataSource, 5),
        _dataSource$ = _dataSource[4],
        childrenMap = _dataSource$ === void 0 ? new Map() : _dataSource$;

    var valueChild;

    var getValueChild = function getValueChild(v) {
      (0, _newArrowCheck2.default)(this, _this3);
      return childrenMap.has(v) ? childrenMap.get(v) : v;
    }.bind(this);

    if (!multiple) {
      valueChild = getValueChild(value);
    } else {
      var _value = value ? (0, _toConsumableArray2.default)(value) : []; // only get the top twenty item child for better performance


      if (_value.length > 20) {
        _value.length = 20;
      }

      valueChild = _value.map(getValueChild);
    }

    if (renderContent) {
      return renderContent(value, valueChild);
    } else {
      return defaultRenderContent(value, valueChild);
    }
  }.bind(this), [dataSource, defaultRenderContent, multiple, renderContent, value]);
  var content = (0, _react.useMemo)(getContent, [getContent]); // 自定义渲染弹层时，开发者可能不传入 options 和 children，导致 content memo deps 不触发变更，故强制更新

  if (renderPopup) content = getContent();

  if (renderSelector) {
    var selector = renderSelector(content, visible) || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);

    return /*#__PURE__*/_react.default.isValidElement(selector) ? /*#__PURE__*/_react.default.cloneElement(selector, rest) : null;
  }

  var title = typeof content === 'string' ? content : undefined;
  return /*#__PURE__*/_react.default.createElement(_style.SSelector, (0, _extends2.default)({
    styleType: "border",
    size: size,
    disabled: disabled,
    title: title
  }, rest), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.selectorContentCls,
    key: "content"
  }, content), /*#__PURE__*/_react.default.createElement(_style.Arrow, {
    key: "icon",
    type: visible ? 'arrow-up' : 'arrow-down'
  }));
}.bind(void 0);

var Popup = function Popup(_ref2) {
  var _this4 = this;

  (0, _newArrowCheck2.default)(this, _this);
  var extra = _ref2.extra,
      _ref2$customStyle = _ref2.customStyle,
      customStyle = _ref2$customStyle === void 0 ? {} : _ref2$customStyle,
      search = _ref2.search,
      multiple = _ref2.multiple,
      emptyContent = _ref2.emptyContent,
      showSelectAll = _ref2.showSelectAll,
      value = _ref2.value,
      renderPopup = _ref2.renderPopup,
      options = _ref2.options,
      children = _ref2.children,
      onChange = _ref2.onChange,
      locale = _ref2.locale,
      handleVisibleChange = _ref2.handleVisibleChange,
      hidePopup = _ref2.hidePopup,
      dataSource = _ref2.dataSource,
      searchValue = _ref2.searchValue,
      setSearchValue = _ref2.setSearchValue,
      virtualList = _ref2.virtualList;
  var handleChange = (0, _react.useCallback)(function (value) {
    (0, _newArrowCheck2.default)(this, _this4);

    if (!multiple) {
      handleVisibleChange(false);
      onChange(value[0]);
    } else {
      onChange(value);
    }
  }.bind(this), [multiple, onChange, handleVisibleChange]);
  var handleSearchInput = (0, _react.useCallback)(function (e) {
    (0, _newArrowCheck2.default)(this, _this4);
    setSearchValue(e.target.value);
  }.bind(this), [setSearchValue]);
  var finalExtra = (0, _react.useMemo)(function () {
    (0, _newArrowCheck2.default)(this, _this4);

    if (typeof extra === 'function') {
      return /*#__PURE__*/_react.default.createElement(_Extra.default, null, extra(hidePopup));
    } else if (!(0, _isEmpty.default)(extra)) {
      if ( /*#__PURE__*/_react.default.isValidElement(extra)) {
        return /*#__PURE__*/_react.default.createElement(_Extra.default, null, extra);
      } else if ((0, _isObject.default)(extra)) {
        var _ref3 = extra,
            _content = _ref3.content,
            rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
        return /*#__PURE__*/_react.default.createElement(_Extra.default, rest, _content);
      }
    }
  }.bind(this), [extra, hidePopup]);

  if (renderPopup) {
    return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderPopup({
      handleVisible: handleVisibleChange,
      onChange: onChange,
      value: value,
      multiple: multiple,
      extra: extra,
      search: search,
      children: children,
      options: options
    }));
  }

  var maxWidth = customStyle.popupMaxWidth ? customStyle.popupMaxWidth : 'none';

  var newCustomStyle = _objectSpread({}, customStyle);

  if (virtualList) {
    newCustomStyle.optionListMaxHeight = 'none';
    if ('optionListMaxHeight' in newCustomStyle) warnLogForCustomHeight();
  }

  var renderEmptyContent = function renderEmptyContent() {
    (0, _newArrowCheck2.default)(this, _this4);
    return emptyContent || /*#__PURE__*/_react.default.createElement(_style.EmptyContentWrapper, null, locale.emptyTip);
  }.bind(this);

  return /*#__PURE__*/_react.default.createElement(_style.MenuWrap, null, search && /*#__PURE__*/_react.default.createElement(_style.SelectSearchInput, {
    onChange: handleSearchInput,
    value: searchValue,
    status: "default"
  }), children || options !== null && options !== void 0 && options.length ? /*#__PURE__*/_react.default.createElement(_style.BlockMenu, {
    onChange: handleChange,
    customStyle: newCustomStyle,
    menuCustomStyle: {
      maxWidth: maxWidth
    },
    dataSource: dataSource,
    multiple: multiple,
    showSelectAll: showSelectAll,
    selectedKeys: multiple ? value : [value],
    virtualList: options ? virtualList : false
  }) : /*#__PURE__*/_react.default.createElement(_style.BlockMenu, null, renderEmptyContent()), finalExtra ? /*#__PURE__*/_react.default.createElement(_style.FooterWrap, null, finalExtra) : null);
}.bind(void 0);

var groupOptionsAsDataSource = function groupOptionsAsDataSource(options) {
  var _this5 = this;

  var globalDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

  var _ref4 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
    subGroupName: 'children',
    displayName: 'label',
    itemKeyName: 'itemKey',
    subGroupKeyName: 'subGroupKey',
    ItemComponent: function ItemComponent() {
      (0, _newArrowCheck2.default)(this, _this5);
      return null;
    }.bind(this),
    SubGroupComponent: function SubGroupComponent() {
      (0, _newArrowCheck2.default)(this, _this5);
      return null;
    }.bind(this)
  },
      subGroupName = _ref4.subGroupName,
      displayName = _ref4.displayName,
      itemKeyName = _ref4.itemKeyName,
      subGroupKeyName = _ref4.subGroupKeyName,
      ItemComponent = _ref4.ItemComponent,
      SubGroupComponent = _ref4.SubGroupComponent;

  var searchValue = arguments.length > 3 ? arguments[3] : undefined;
  var handleSearch = arguments.length > 4 ? arguments[4] : undefined;
  var subGroupMap = new Map();
  var childrenMap = new Map();

  var isValidKey = function isValidKey(v) {
    (0, _newArrowCheck2.default)(this, _this5);
    return typeof v === 'string' || typeof v === 'number';
  }.bind(this);

  var group = function group(options) {
    var _this6 = this;

    var disabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
    var prefixKey = arguments.length > 2 ? arguments[2] : undefined;
    var validKeys = [];
    var disabledKeys = [];
    var renderChildren = [];
    options.forEach(function (child, i) {
      (0, _newArrowCheck2.default)(this, _this6);
      var subChildren = child[subGroupName];

      if (subChildren) {
        var _key = child[subGroupKeyName] || child.key || "".concat(prefixKey, "-").concat(i);

        var reactKey = child.key || isValidKey(child[subGroupKeyName]) ? child[subGroupKeyName] : "".concat(prefixKey, "-").concat(i);
        var isDisabled = disabled || child.disabled;

        var _group = group(subChildren, isDisabled, _key),
            _group2 = (0, _slicedToArray2.default)(_group, 3),
            subValidKeys = _group2[0],
            subDisabledKeys = _group2[1],
            subRenderChildren = _group2[2];

        subGroupMap.set(_key, {
          validKeys: subValidKeys,
          disabledKeys: subDisabledKeys
        });
        validKeys.push.apply(validKeys, (0, _toConsumableArray2.default)(subValidKeys));
        disabledKeys.push.apply(disabledKeys, (0, _toConsumableArray2.default)(subDisabledKeys));

        var _visible = searchValue ? !!subRenderChildren.length : true;

        if (_visible) {
          renderChildren.push( /*#__PURE__*/_react.default.createElement(SubGroupComponent, (0, _extends2.default)({
            key: reactKey
          }, child, (0, _defineProperty2.default)({
            disabled: globalDisabled || isDisabled
          }, subGroupKeyName, _key)), subRenderChildren));
        }
      } else {
        var _ref6;

        var _key2 = child[itemKeyName] === undefined ? child.key : child[itemKeyName];

        var _reactKey = child.key || isValidKey(child[itemKeyName]) ? child[itemKeyName] : "".concat(prefixKey, "-").concat(i);

        var _isDisabled = disabled || child.disabled;

        if (_isDisabled) {
          disabledKeys.push(_key2);
        } else {
          validKeys.push(_key2);
        }

        var display = (_ref6 = child[displayName]) !== null && _ref6 !== void 0 ? _ref6 : _key2;

        var _visible2 = searchValue ? handleSearch(_key2, child) : true;

        if (_visible2) {
          renderChildren.push( /*#__PURE__*/_react.default.createElement(ItemComponent, (0, _extends2.default)({
            key: _reactKey
          }, child, (0, _defineProperty2.default)({
            disabled: globalDisabled || _isDisabled
          }, itemKeyName, _key2)), display));
        }

        childrenMap.set(_key2, display);
      }
    }.bind(this));
    return [validKeys, disabledKeys, renderChildren];
  };

  return [].concat((0, _toConsumableArray2.default)(group(options, false, 'group-root')), [subGroupMap, childrenMap]);
};

var Select = function Select(_ref8) {
  var _search,
      _search2,
      _search3,
      _this7 = this;

  (0, _newArrowCheck2.default)(this, _this);
  var _ref8$size = _ref8.size,
      size = _ref8$size === void 0 ? 'md' : _ref8$size,
      _value = _ref8.value,
      defaultValue = _ref8.defaultValue,
      _onChange = _ref8.onChange,
      _ref8$onVisibleChange = _ref8.onVisibleChange,
      onVisibleChange = _ref8$onVisibleChange === void 0 ? _noop.default : _ref8$onVisibleChange,
      disabled = _ref8.disabled,
      search = _ref8.search,
      multiple = _ref8.multiple,
      renderContent = _ref8.renderContent,
      renderSelector = _ref8.renderSelector,
      placeholder = _ref8.placeholder,
      _locale = _ref8.locale,
      options = _ref8.options,
      children = _ref8.children,
      emptyContent = _ref8.emptyContent,
      showSelectAll = _ref8.showSelectAll,
      extra = _ref8.extra,
      customStyle = _ref8.customStyle,
      popover = _ref8.popover,
      popoverProps = _ref8.popoverProps,
      renderPopup = _ref8.renderPopup,
      virtualList = _ref8.virtualList,
      rest = (0, _objectWithoutProperties2.default)(_ref8, _excluded3);

  var _useUncontrolled = (0, _useUncontrolled5.default)(_value, defaultValue, _onChange),
      _useUncontrolled2 = (0, _slicedToArray2.default)(_useUncontrolled, 2),
      value = _useUncontrolled2[0],
      onChange = _useUncontrolled2[1];

  var _useState = (0, _react.useState)(false),
      _useState2 = (0, _slicedToArray2.default)(_useState, 2),
      visible = _useState2[0],
      setVisible = _useState2[1];

  var locale = (0, _useLocale.default)(_zh_CN.default, 'Select', _locale);
  if (search === true) search = {};

  var _useUncontrolled3 = (0, _useUncontrolled5.default)((_search = search) === null || _search === void 0 ? void 0 : _search.searchValue, ((_search2 = search) === null || _search2 === void 0 ? void 0 : _search2.defaultSearchValue) || '', (_search3 = search) === null || _search3 === void 0 ? void 0 : _search3.onSearchValueChange),
      _useUncontrolled4 = (0, _slicedToArray2.default)(_useUncontrolled3, 2),
      searchValue = _useUncontrolled4[0],
      setSearchValue = _useUncontrolled4[1];

  (0, _useInitial.default)(function () {
    (0, _newArrowCheck2.default)(this, _this7);
    if (popover) deprecatedLogForPopover();
    if (virtualList && !options) warnLogForVirtualList();
  }.bind(this));
  var handleSearch = (0, _react.useCallback)(function (value, props) {
    var _this8 = this;

    (0, _newArrowCheck2.default)(this, _this7);

    if (!search || !searchValue) {
      return true;
    }

    if ((0, _typeof2.default)(search) === 'object' && search.handleSearch) {
      var _beforeProps$label;

      // assign props for forward compatible
      var beforeProps = _objectSpread({}, props);

      if (options) beforeProps.children = (_beforeProps$label = beforeProps.label) !== null && _beforeProps$label !== void 0 ? _beforeProps$label : beforeProps.value;

      var itemInfo = _objectSpread({}, props);

      if (!('props' in itemInfo)) {
        Object.defineProperty(itemInfo, 'props', {
          get: function get() {
            (0, _newArrowCheck2.default)(this, _this8);
            warnLogForSearchProps();
            return beforeProps;
          }.bind(this)
        });
      }

      return search.handleSearch(searchValue, value, itemInfo);
    } else {
      // use label for options case
      var _children = options ? props.label : props.children;

      return (value + '').indexOf(searchValue) >= 0 || _children && typeof _children === 'string' && _children.indexOf(searchValue) >= 0;
    }
  }.bind(this), [options, search, searchValue]);
  var childrenDataSource = (0, _react.useMemo)(function () {
    (0, _newArrowCheck2.default)(this, _this7);
    return options ? [] : (0, _group3.groupChildrenAsDataSource)(children, disabled, groupOptions);
  }.bind(this), [children, disabled, options]);
  var optionsDataSource = (0, _react.useMemo)(function () {
    (0, _newArrowCheck2.default)(this, _this7);
    return options ? groupOptionsAsDataSource(options, disabled, groupOptions, searchValue, handleSearch) : [];
  }.bind(this), [disabled, handleSearch, options, searchValue]);
  virtualList = (0, _react.useMemo)(function () {
    (0, _newArrowCheck2.default)(this, _this7);
    return options ? virtualList : false;
  }.bind(this), [options, virtualList]);
  var dataSource = (0, _react.useMemo)(function () {
    (0, _newArrowCheck2.default)(this, _this7);
    return options ? optionsDataSource : childrenDataSource;
  }.bind(this), [options, childrenDataSource, optionsDataSource]);
  var handleVisibleChange = (0, _react.useCallback)(function (open) {
    (0, _newArrowCheck2.default)(this, _this7);
    setVisible(open);
    onVisibleChange(open);
  }.bind(this), [onVisibleChange]);
  var hidePopup = (0, _react.useCallback)(function () {
    (0, _newArrowCheck2.default)(this, _this7);
    return handleVisibleChange(false);
  }.bind(this), [handleVisibleChange]);
  return /*#__PURE__*/_react.default.createElement(_ConfigContext.default.Consumer, null, function (configContext) {
    (0, _newArrowCheck2.default)(this, _this7);
    var popupConfigProps = (0, _usePopoverConfig.getPopoverConfigFromContext)(configContext);
    return /*#__PURE__*/_react.default.createElement(_SelectContext.default.Provider, {
      value: {
        hidePopup: hidePopup,
        handleSearch: handleSearch,
        searchValue: searchValue
      }
    }, /*#__PURE__*/_react.default.createElement(_style.SelectWrap, rest, /*#__PURE__*/_react.default.createElement(_Popover.default, (0, _extends2.default)({
      onVisibleChange: handleVisibleChange,
      placement: "bottomLeft",
      trigger: ['click']
    }, popupConfigProps, {
      visible: visible
    }, popover, popoverProps, {
      popup: /*#__PURE__*/_react.default.createElement(Popup, {
        extra: extra,
        customStyle: customStyle,
        search: search,
        multiple: multiple,
        emptyContent: emptyContent,
        showSelectAll: showSelectAll,
        value: value,
        renderPopup: renderPopup,
        options: options,
        children: children,
        onChange: onChange,
        locale: locale,
        handleVisibleChange: handleVisibleChange,
        hidePopup: hidePopup,
        dataSource: dataSource,
        searchValue: searchValue,
        setSearchValue: setSearchValue,
        virtualList: virtualList
      }),
      forceRender: false
    }), /*#__PURE__*/_react.default.createElement(Selector, {
      size: size,
      disabled: disabled,
      multiple: multiple,
      placeholder: placeholder,
      renderContent: renderContent,
      renderSelector: renderSelector,
      renderPopup: renderPopup,
      value: value,
      visible: visible,
      locale: locale,
      dataSource: dataSource
    }))));
  }.bind(this));
}.bind(void 0);

Select.propTypes = {
  placeholder: _propTypes.default.node,
  onChange: _propTypes.default.func,
  options: _propTypes.default.arrayOf(_propTypes.default.shape({
    label: _propTypes.default.node
  })),
  extra: _propTypes.default.oneOfType([_propTypes.default.shape({
    content: _propTypes.default.node.isRequired
  }), _propTypes.default.node, _propTypes.default.func]),
  multiple: _propTypes.default.bool,
  showSelectAll: _propTypes.default.bool,
  disabled: _propTypes.default.bool,
  renderContent: _propTypes.default.func,
  renderSelector: _propTypes.default.func,
  renderPopup: _propTypes.default.func,
  search: _propTypes.default.oneOfType([_propTypes.default.oneOf([true]), _propTypes.default.shape({
    handleSearch: _propTypes.default.func,
    searchValue: _propTypes.default.string,
    defaultSearchValue: _propTypes.default.string,
    onSearchValueChange: _propTypes.default.func
  })]),
  popover: _propTypes.default.any,
  popoverProps: _propTypes.default.any,
  onVisibleChange: _propTypes.default.func,
  locale: _propTypes.default.any,
  customStyle: _propTypes.default.shape({
    optionListMaxHeight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
    popupMaxWidth: _propTypes.default.string,
    popupWidth: _propTypes.default.string
  }),
  emptyContent: _propTypes.default.node,
  virtualList: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
    simple: _propTypes.default.oneOf([true]),
    height: _propTypes.default.number
  })])
};
var _default = Select;
exports.default = _default;