import _extends from "@babel/runtime/helpers/extends";
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
import React from 'react';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import FormField from '../FormField';
import Select from '../Select';

/**
 * `FormFieldSelect` componentis is used for making a choice among a set of related options.
 * See description of `Select` for [the full list of properties](#!/Select) of this component.
 * @since 1.12.3
 */
const FormFieldSelect = ({
  size,
  baseClassName = "".concat(CLS_PREFIX, "form-field-select"),
  className,
  children,
  searchable,
  clearable,
  multiple,
  placeholder,
  ...props
}) => /*#__PURE__*/React.createElement(FormField, _extends({
  className: classNames(baseClassName, className)
}, props), ({
  getId,
  getName,
  setValue,
  getValue,
  isDisabled
}) => /*#__PURE__*/React.createElement(Select, {
  size: size,
  id: getId(),
  name: getName(),
  value: getValue(''),
  onChange: setValue,
  disabled: isDisabled(),
  searchable: searchable,
  clearable: clearable,
  multiple: multiple,
  placeholder: placeholder
}, children));

export default FormFieldSelect;