'use strict';

exports.__esModule = true;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Dialog = require('./../Dialog');

var _Dialog2 = _interopRequireDefault(_Dialog);

var _MenuTiled = require('./../MenuTiled');

var _MenuTiled2 = _interopRequireDefault(_MenuTiled);

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

var DropdownDialog = (0, _react.forwardRef)(function (_ref, ref) {
  var show = _ref.show,
      _ref$dialogProps = _ref.dialogProps,
      dialogProps = _ref$dialogProps === undefined ? {} : _ref$dialogProps,
      multiple = _ref.multiple,
      list = _ref.list,
      selected = _ref.selected,
      onChange = _ref.onChange,
      _ref$menutiledProps = _ref.menutiledProps,
      menutiledProps = _ref$menutiledProps === undefined ? {} : _ref$menutiledProps;

  return _react2.default.createElement(
    _Dialog2.default,
    _extends({
      animation: 'slideDown',
      show: show,
      style: {
        width: '100%'
      }
    }, dialogProps),
    _react2.default.createElement(_MenuTiled2.default, _extends({
      multiple: multiple,
      list: list,
      selected: selected,
      onChange: onChange
    }, menutiledProps, {
      cancelAttribute: {
        onClick: dialogProps.maskAttribute && dialogProps.maskAttribute.onClick ? dialogProps.maskAttribute.onClick : null
      }
    }))
  );
});

exports.default = DropdownDialog;
module.exports = exports['default'];