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; };

import React, { forwardRef } from 'react';
import Dialog from './../Dialog';
import MenuTiled from './../MenuTiled';

var DropdownDialog = 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 React.createElement(
    Dialog,
    _extends({
      animation: 'slideDown',
      show: show,
      style: {
        width: '100%'
      }
    }, dialogProps),
    React.createElement(MenuTiled, _extends({
      multiple: multiple,
      list: list,
      selected: selected,
      onChange: onChange
    }, menutiledProps, {
      cancelAttribute: {
        onClick: dialogProps.maskAttribute && dialogProps.maskAttribute.onClick ? dialogProps.maskAttribute.onClick : null
      }
    }))
  );
});

export default DropdownDialog;